首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > C++ >

请问VC.net2003下的控制台程序

2012-03-07 
请教VC.net2003下的控制台程序#includestdafx.h classpoint{public:intxintyvoidoutput(){cout x

请教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 是一个词 中间没有空格

热点排行