Mar 24, 2008 at 7:51pm
Does new initialize memory to 0?
Mar 24, 2008 at 9:44pm
No, not in cases like this:
1 2
|
int* i = new int;
int* array = new int[100];
|
But in this case, SomeClass's constructor is called, and usually a constructor initializes all data.
1 2
|
class SomeClass;
SomeClass* c = new SomeClass;
|
Last edited on Mar 24, 2008 at 9:44pm