Originally Posted by zamjad
Without going into advantages and disadvantages here is the simplest implementation of Singleton without using Heap
static Singleton obj;
This will be useful in single threaded application.
Good that u tried to do one without dynamic allocation. But one thing we should be carefull about is Static objects get created at start of program, so the objects gets created before main() which calls its constructor before. How we implement inside constructor also matters.