听孙鑫老师的视频,第一个例子照着做的,就有毛病了,请高手指教一下
#include<iostream.h>struct Pt
{int x;
int y;
}
void main()
{Pt p;
p.x=2;
p.y=9;
cout<<p.x<<endl<<p.y<<endl;
}
错误提示:D:\BB\a\a.cpp(6) : error C2628: 'Pt' followed by 'void' is illegal (did you forget a ';'?)
D:\BB\a\a.cpp(11) : warning C4508: 'main' : function should return a value; 'void' return type assumed
Error executing cl.exe.
a.exe - 1 error(s), 1 warning(s)