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

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

错误的举例如:

class ClassName{

}

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

正确如:

class ClassName{

};
Reference
  1. constructors not allowed a return type错误问题
posted @ 2019-03-13 21:37  五毛钱的饼  阅读(1127)  评论(0编辑  收藏  举报