20 12
发新话题
打印

VS2005 C++的问题

VS2005 C++的问题

我新一个Win32空项目:
加一个CPP文件
代码如下:
#include<iostream.h>
void main()
{
    cout<<"hello Word"<<endl;
}

这样编译通不过,问题在cout上,
但是在VS6中通得过
为什么?
看一下 iostream.h  发现里边的内容跟6.0中是很不一样,
iostream.h  不是标准C++中的类的头文件吗?怎么会不一样呢
VS2005不兼容吗?
还请朋友么帮帮忙

TOP

#include<iostream>

TOP

关于头文件,
我试过了,
#include <iostram>
#include "iostream"
#include <iostram.h>
#include "iostram.h"

可是都不行,不知为什么?
楼上的测试过了吗?
如果确定可以的话,就可能是我的环境配置出了问题

TOP

void main()
{
……
}

这样试试
int main()
{
……
return 0;
}

TOP

加上下面这句
using namespace std;

TOP

试试std::cout<<"hello Word"<<std::endl;
Free as in free speech, not as in free beer.
www.nill.cn

TOP

VC新版本更遵守ISO标准了,原因就在于此
Free as in free speech, not as in free beer.
www.nill.cn

TOP

路过,不会 VC++

TOP

首先应该#include<iostream>
其次using namespace std;或者std::cout<<"hello world"<<std::endl;

TOP

using namespace std;
来单来单来单 :

TOP

 20 12
发新话题