在vc6.0里,定义了一个string 类型的变量,想输出这个变量怎么就出现这样的错误呢?
D:\programe\strandchar\1.cpp(10):errorC2679:binary'<<':nooperatordefinedwhichtakesari...
D:\programe\str and char\1.cpp(10) : 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)
程序如下:
#include<iostream>
using namespace std;
void main()
{
string st="abc";
cout << st <<"\n";
} 展开
程序如下:
#include<iostream>
using namespace std;
void main()
{
string st="abc";
cout << st <<"\n";
} 展开
3个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询