c++ error

来源:百度知道 编辑:UC知道 时间:2024/05/13 15:52:11
error C2679: binary '<<' : no operator defined which takes a right-hand operand of type 'class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >' (or there is no acceptable convers

请问这是什么错误,该如何解决??

错误是说没有对std::string对象重载的右移运算符(且是右结合的),通常这个运算符会被重载作为输出流的一个操作,可能是缺少#include <string>
或者没有声明使用命名空间std

将代码贴出来。

可能是缺少头文件<string>

晕倒,居然跟我10分钟前出现的问题一样。

不过我忘记是什么原因了,不是头文件的,好象是右操作数没有确定,或者是类型之间的转换出了问题了

你把代码帖出来吧。