相关疑难解决方法(0)

错误C2679:二进制'<<':找不到哪个运算符采用'std :: string'类型的右手操作数(或者没有可接受的转换)

这是我的代码,如何修复此错误?

#include "stdafx.h"
#include <iostream>

using namespace std;

int main()
{
    string title = "THE WORLD OF PIRATES";
    cout << title << endl;
    cout << " Welcome to the world of pirates";

    cin.get();

    return 0;
}
Run Code Online (Sandbox Code Playgroud)

错误是

binary '<<' : no operator found which takes a right-hand operand of type 'std::string' (or there is no acceptable conversion)
Run Code Online (Sandbox Code Playgroud)

c++ c++11 visual-studio-2012

21
推荐指数
1
解决办法
5万
查看次数

标签 统计

c++ ×1

c++11 ×1

visual-studio-2012 ×1