zl程序教程

您现在的位置是:首页 >  后端

当前栏目

c++ constructors not allowed a return type错误问题

C++错误 not type Allowed return 问题
2023-09-11 14:20:09 时间

出现这样的问题 constructors not allowed a return type,是因为类定义或者申明时,结束的地方忘了加个’ ; ‘

错误的举例如:

class ClassName{

}

如上面的定义,需要在类申明结束的部分添加";"结束符号

正确如:

class ClassName{

};
Reference
  1. constructors not allowed a return type错误问题