求解这个程序为什么错误?
[code=C/C++][/code]
#include <iostream>
using namespace std;
struct X{
int b;
void c();
int d(int);
}
void X::c()
{
cout<<"dfgdas"<<endl;
}
int X::d(int w)
{
b=w;
return b;
}
int main(){
X x;
x.c();
cout<<x.d(3)<<endl;
}
[解决办法]
结构体的“}”后少了一个分号“;”
[解决办法]
楼上正解