高手帮我看看这条c++错误是什么意思?在线等!

来源:百度知道 编辑:UC知道 时间:2024/09/22 15:37:27
用Visual c++6.0的软件,用的C++面向对象程序设计的知识。
编译时,错误总指在有cout〈〈、cin〉〉a等处,写的是:
binary '>>' : no operator defined which takes a right-hand operand of type 'class std::basic_string<char,struct std::allocator<char>

就只有这一个错误,怎么想也想不出哪里错了。
求高手帮帮我!!!

可以给你举个简单的例子
#include<iostream>//iostream 控制输出输入流
using namespace std;
void main()
{
int a;
cout<<"Please input a num:"<<endl;
cin>>a;
cout<<"The num is:"<<a<<endl;
}

请包含 iostream 头文件和std命名空间

#include <iostream>

using namespace std;