error C2679: binary '<<' : no operator defined which takes a right-hand operand of type 'class Stude
2017-04-16 21:59
423 查看
#include "1.h" #include Student::Student() { mstr_name="xiao"; mstr_age=27; cout<
网上搜了一下,很多人说是因为没有#include <string>的缘故,但是反复确认后发现我有做到。百思不得其解,还一度以为不同文件的头文件需要重复引用<string>,但是在每个文件的头文件都添加了<string>,依然出现这个error。
这个出现的error,谷歌度娘都问过了依旧无解,最后自己重新尝试之后找到解决方案:
元;
原来出现的error是在打印输出的时候没有标识双引号,因为我们一般引用的函数无需标双引号,但是构造函数输出的函数需要双引号标识。
解决方法:
把构造函数输出的结果标识上双引号。
相关文章推荐
- error C2679: binary '<<' : no operator defined which takes a right-hand operand of type '' (or there is no acceptable conversion
- error C2679: binary '<<' : no operator defined which takes a right-hand operand of type '' (or there is no acceptable conversion
- 解决 C++错误 error C2679: binary '=' : no operator defined which takes a right-hand operand of type 'class CString' (or there is no
- 错误 1 error C2679: binary '<<' : no operator found which takes a right-hand operand of type 'std::str
- error C2679: binary '<<' : no operator found which takes a right-hand operand of type 'std::string'
- error C2679: binary '<<' : no operator found which takes a right-hand operand of type 'std::wstring'
- error C2679: binary '<<' : no operator found which takes a right-hand operand of type 'std::wstring'
- error C2679: binary '<<' : no operator found which takes a right-hand operand of type 'std::string'
- Error 1 error C2679: binary '>>' : no operator found which takes a right-hand operand of type 'std::
- C2679: binary '<<' : no operator found which takes a right-hand operand of type 'const std::basic
- C++,如何输出string类型的数据(报错:no operator defined which takes a right-hand operand of type 'class std::bas)
- error C2678: binary '>>' : no operator found which takes a left-hand operand of type 'std::
- error C2679: binary '<<' : no operator defined which takes a right-hand operand of type 'class std::basic_s
- error C2677: binary '-' : no global operator defined which takes type 'class CString' (or there is n
- 【原】error C2679: binary '<<' : no operator found which takes a right-hand operand of type 'std::string'
- error C2679: binary '<<' : no operator found 解决办法
- No matching bean of type [xx] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency
- ** exception error: no match of right hand side value
- type parameters of <T>T cannot be determined; no unique maximal instance exists for type variable T with upper bounds int,java.lang.Object
- Error Log: type parameters of <T>T cannot be determined; no unique maximal instance exists for ...