Class instantiation

MyClass objClass;

objClass.saveStuff();

/*==================================*/


MyClass* objClass = new MyClass();

objClass->saveStuff();



In theory, what is the difference between the two class instantiations above?




Last edited on
Besides the fact that the second one is a pointer and dynamically allocated?
Well the second one uses up about 4 more bytes of space (pointer, plus the object). Besides that I can't say. I lack the experience to think further on the matter.
Topic archived. No new replies allowed.