cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
Beginners
Class instantiation
Class instantiation
Feb 21, 2010 at 2:21am UTC
jhessie
(1)
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
Feb 21, 2010 at 2:22am UTC
Feb 21, 2010 at 2:37am UTC
tummychow
(1210)
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.