可能重复:
Do the parentheses after the type name make a difference with new?以下几点有什么区别?
假设A
与构造等正确定义一个类,就是它们之间的区别?
A *ptrA = new A;
A *ptrA = new A();
可能重复:
Do the parentheses after the type name make a difference with new?以下几点有什么区别?
假设A
与构造等正确定义一个类,就是它们之间的区别?
A *ptrA = new A;
A *ptrA = new A();
这取决于A
的定义 - “一类的正确与构造等定义”是非常无益的和令人印象深刻的模糊。
它们是同
大部分时间,是的,但检查http://stackoverflow.com/questions/620137/do-the-parentheses-after-the-type-name-make-a-difference-with-new – 2010-06-25 21:01:45
可能的复制http://stackoverflow.com/questions/620137/do-the-parentheses-after-the-type-name-make-a-difference-with-new – 2010-06-25 20:49:05
Downvote原因? – 2010-06-25 20:51:20