Com*_*erd -2 c++ debugging class
这是我的班级 employeeException
#include <iostream>
#include <string>
using namespace std;
class employeeException
{
public:
employeeException(string);
void printmessage();
private:
string message;
};
int main()
{
employeeException("Heelo");
}
employeeException::employeeException(string message)
{
this->message = message;
}
void employeeException:printmessage()
{
cout<<endl
<<this->message
<<endl;
}
Run Code Online (Sandbox Code Playgroud)
由于某些未知原因,我在编译期间遇到此错误
函数定义不声明参数
我无法弄清楚这个简单程序有什么问题.当然,我错过了一些简单的事情.
void employeeException:printmessage()
^ - missing a colon
{
cout<<endl
<<this->message
<<endl;
}
Run Code Online (Sandbox Code Playgroud)