- 论坛徽章:
- 0
|
代码如下:
#include <iostream.h>;
class Tcpxm
{
public:
int myread(int x,int y)
{
n=x*y;
return n;
}
private:
int n;
}
void main()
{
Tcpxm test;
int a=2,b=2,c;
c=test.myread(a,b);
cout<<c<<endl;
}
编译时提示:
--------------------Configuration: Tcpxm - Win32 Debug--------------------
Compiling...
Tcpxm.cpp
F:\iProgram\cp\new\Tcpxm.cpp(16) : error C2628: 'Tcpxm' followed by 'void' is illegal (did you forget a ';'?)
F:\iProgram\cp\new\Tcpxm.cpp(22) : warning C4508: 'main' : function should return a value; 'void' return type assumed
Error executing cl.exe.
Tcpxm.exe - 1 error(s), 1 warning(s)
请问哪里错了? |
|