16
可能重复:
Do the parentheses after the type name make a difference with new?不使用在构造函数调用括号中新(C++)
所以我在我的主:
Class* pC = new Class;
这是工作的
Class* pC = new Class();
我在今天才意识到我已经省略了括号(所以我被某种方式中最令人头痛的解析的“反面”所击中)。
我的问题:这两种形式是否相同?
两个调用调用默认的构造函数。 –