VC++报错,求助

来源:百度知道 编辑:UC知道 时间:2024/09/22 05:24:22
visual c++6.0报错:

--------------------Configuration: chengxu - Win32 Debug--------------------
Compiling...
1.cpp
C:\Program Files\Microsoft Visual Studio\MyProjects\chengxu\1.cpp(4) : error C2065: 'cout' : undeclared identifier
C:\Program Files\Microsoft Visual Studio\MyProjects\chengxu\1.cpp(4) : error C2297: '<<' : illegal, right operand has type 'char [9]'
Error executing cl.exe.

chengxu.exe - 2 error(s), 0 warning(s)

请问各位大人,这是什么意思啊。。。。

在你的文件前面加上
#include <iostream.h>就好了

C:\Program Files\Microsoft Visual Studio\MyProjects\chengxu\1.cpp(4) : error C2065: 'cout' : undeclared identifier :
cout 未定义
C:\Program Files\Microsoft Visual Studio\MyProjects\chengxu\1.cpp(4) : error C2297: '<<' : illegal, right operand has type 'char [9]'

<< 操作非法 ,右边操作数类型不对

加头文件
#include<iostream.h>

#include <iostream.h>