请教VC.net2003下的控制台程序
#include "stdafx.h "
class point
{
public:
int x;
int y;
void output()
{
cout < <x < <end1 < <y < <end1;
}
}
int _tmain(int argc, _TCHAR* argv[])
{
point pt;
pt.x=5;
pt.y=5;
pt.output();
return 0;
}
我学的是VC6.0
在VC.net下写这个程序
编译不通过
高手指教
[解决办法]
class point
{
public:
int x;
int y;
void output()
{
cout < <x < <end1 < <y < <end1;
}
} <=======少了一个;号
int _tmain(int argc, _TCHAR* argv[])
{
point pt;
pt.x=5;
pt.y=5;
pt.output();
return 0;
}
[解决办法]
end1?
应该是endl是L,不是1
还有,你因该加上 include <iostream> using namespace std;
[解决办法]
如果你是
include <iostream.h>
改成
include <iostream>
using namespace std;
[解决办法]
把第一行 挪到第三行 namespace 是一个词 中间没有空格