Stuff *s = new Stuff;and
Stuff s;If you use new, some memory from the heap will be allocated for s. And the ctor of Stuff is called.
If you had too much C#, you may think that "Stuff s" does almost nothing other than declaring something. But in C++, "Stuff s" actually call the ctor of Stuff. And the memory required by s is taken from the stack. And the ctor of Stuff is called.
When do you release the memory then? If you use new, you have to delete s somewhere in the program. If you don’t use new, the dtor of Stuff will be called before the current scope exits. The call to the dtor is actually generated by the compiler.
Compile the following to see clearly what happens when you are not using new:
Did you notice that dtor is called even though you did not do anything? The following disassembled output shows that the compiler generated the call to dtor.