【发布时间】:2011-04-10 08:17:12
【问题描述】:
可能重复:
Do the parentheses after the type name make a difference with new?
在C++中,这两个语句有什么区别?
Class clg
{
public :
int x,y,z;
};
int main(void)
{
clg *ptrA = new clg; //
clg *ptrB = new clg(); // what is the importance of "()" ???
return 0;
}
【问题讨论】:
标签: c++ syntax constructor initialization new-operator