【c++错误】类的语法错误 error c2533:constructors not allowed a return type(构造函数不允许返回一个类型)

今天编写类的程序的时候不小心把类后的分号忘写了,就出现上面的错误提示。
顺便复习下类的正确格式:
class 类名  
{  
public:      //习惯上将公有类型放在前面,便于阅读  
         ……(外部接口)  
protected:   
         …… (保护型成员)  
private:  
         ……(私有成员)  
};          //这里的分号千万不能忘写,不然会出现错误error: 2533:constructors not allowed a return type  

 

posted @ 2017-02-18 15:40  天秤libra  阅读(666)  评论(0编辑  收藏  举报