What is the difference between the following? [duplicate]
Possible Duplicate:
Do the parentheses after the type name make a difference with new?
Assuming A
is a开发者_Python百科 class properly defined with constructors etc., what is the difference between these?
A *ptrA = new A;
A *ptrA = new A();
It depends on the definition of A
- "a class properly defined with constructors etc" is very unhelpful and impressively vague.
They are the same
精彩评论