开发者

What is the difference between the following? [duplicate]

开发者 https://www.devze.com 2023-01-04 15:32 出处:网络
This question already has answers here: Closed 12 years ago. Possible Duplicate: Do the parentheses after the type name make a difference with new?
This question already has answers here: Closed 12 years ago.

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

0

精彩评论

暂无评论...
验证码 换一张
取 消