关于C++语法的一个容易出错的地方。 1 class Widget { 2 }; 3 4 Widget w(); 如上所示代码,并没有声明一个class Widget w。 这是声明了一个函数w,返回值是Widget,不接收参数输入。