C + + Programming concealment error: Error C2533: constructor cannot have return type
Today, when writing a class, there are errors.
Indicates that a class's constructor cannot have a return type.
In the CPP file, there is no return type at the constructor definition. In the header file, there is no return type for the constructor prototype.
It's strange that, with years of programming experience, there seem to be some familiar inspirations (which seemed to have made the same mistake before)
Then at the end of the header file, you find that the end of a class is not written with a semicolon. (Be careful and careful!!!) )
It appears that when the head file is included in the CPP file, the class without the semicolon is mistaken for the return type of the constructor that is suggesting the error.
It is hereby noted.
Original: http://hi.baidu.com/dalugun/item/d1f3f8e466d98ba8c00d75f0
Ext: C + + Programming concealment error: Error C2533: constructor cannot have return type