c++ 输出string的问题 cout << string
2010-02-22 11:12
435 查看
us.name = "123";
cout << us.name << endl;
=====================================
程序运行时报一个异常
C2679: binary '<<' : no operator defined which takes a right-hand operand of type
错误原因:在#include<iostream.h>中string类没有重载"<<"操作符.
cout << us.name.c_str() << endl;
cout << us.name << endl;
=====================================
程序运行时报一个异常
C2679: binary '<<' : no operator defined which takes a right-hand operand of type
错误原因:在#include<iostream.h>中string类没有重载"<<"操作符.
cout << us.name.c_str() << endl;
相关文章推荐
- c++ 输出string的问题 cout << string
- C++中Cout<<的运算符重载后优先级问题
- 后台List<String> list 传到前台 select输出 问题
- 相对printf(),对于多线程的cout<<输出乱码的问题
- C++中#include<string>的问题
- C++中关于string类型究竟能不能用cout输出的问题
- cout 堆栈,operator<< 运算符重载输出问题
- C++_重载运算符<< ostream流重载注意事项_使自定义数据可以用cout输出
- C++中关于string类型究竟能不能用cout输出的问题
- c++ cout控制输出 &lt;转&gt;
- C++中关于string类型究竟能不能用cout输出的问题(转载https://www.cnblogs.com/mzct123/p/4876185.html)
- C++用map记录字符串,怎么用map<string,int>才会不超时
- [C++基础]cout与wcout,printf与wprintf,ofstream与wofstream关于输出中文的问题解决
- C/C++ standard library -- <cstring>(string.h)
- cout不能直接输出string字符串的问题
- cout <<string对象 编译出错引发的思考
- JSTL <c:out value="${EL}">不能正确输出的问题
- cout<<字符数组 getline(流,string,delimit character) 遇到的问题
- 【Java】ArrayList<String>转化为String数组问题
- C++库常用函数一览(<string><cctype><algorithm><cmath><cstdlib><iomanip><numeric>)