![]() |
#2
马可2013-04-02 13:32
|

#include <iostream>
#include "stdafx.h"
using namespace std;
int main ()
{
cout <<"hello world" ;
return 0;
}得到的结果如下:
1>------ 已启动生成: 项目: ex3, 配置: Debug Win32 ------
1> 源.cpp
1>e:\ex3\ex3\源.cpp(1): warning C4627: “#include <iostream>”: 在查找预编译头使用时跳过
1> 将指令添加到“stdafx.h”或重新生成预编译头
1>e:\ex3\ex3\源.cpp(7): error C2065: “cout”: 未声明的标识符
========== 生成: 成功 0 个,失败 1 个,最新 0 个,跳过 0 个 ==========
#include "stdafx.h"
using namespace std;
int main ()
{
cout <<"hello world" ;
return 0;
}得到的结果如下:
1>------ 已启动生成: 项目: ex3, 配置: Debug Win32 ------
1> 源.cpp
1>e:\ex3\ex3\源.cpp(1): warning C4627: “#include <iostream>”: 在查找预编译头使用时跳过
1> 将指令添加到“stdafx.h”或重新生成预编译头
1>e:\ex3\ex3\源.cpp(7): error C2065: “cout”: 未声明的标识符
========== 生成: 成功 0 个,失败 1 个,最新 0 个,跳过 0 个 ==========
请问一下,这个是什么原因啊,cout 不是在namespace 里已经声明过了吗?