¡@

Home 

c++ Programming Glossary: helpfulcontainer

C++: Creating a shared object rather than a shared pointer to an object

http://stackoverflow.com/questions/4410790/c-creating-a-shared-object-rather-than-a-shared-pointer-to-an-object

mX x virtual int getX const return mX private int mX class HelpfulContainer public Don't worry I'll manager the memory from here. void eventHorizon.. It's too late to save it now endl delete a a NULL int main HelpfulContainer helpfulContainer A a1 new A 1 A a2 new A a1 cout a1 a1 endl.. things happen when running this line. Whoever created the HelpfulContainer wasn't thinking about others wanting to retain pointers to A..