-1

Possible Duplicate:
Do the parentheses after the type name make a difference with new?

Assuming A is a class properly defined with constructors etc., what is the difference between these?

A *ptrA = new A;
A *ptrA = new A();
Community
  • 1
  • 1
nsivakr
  • 1,565
  • 2
  • 25
  • 46

2 Answers2

1

It depends on the definition of A - "a class properly defined with constructors etc" is very unhelpful and impressively vague.

JoeG
  • 12,994
  • 1
  • 38
  • 63
0

They are the same

pm100
  • 48,078
  • 23
  • 82
  • 145
  • Most of the time, yes, but check http://stackoverflow.com/questions/620137/do-the-parentheses-after-the-type-name-make-a-difference-with-new – Daniel Rodriguez Jun 25 '10 at 21:01