コードを書き始めていました。キャストする方法をまだ覚えているかどうかを調べるために、演算子の下に赤い線が表示されるまでテストしました。 これは、コンパイラのエラーです:挿入演算子がベクターで動作していないとわからない理由
Error C2679: binary '<<': no operator found which takes a right-hand operand of type 'std::basic_string<char,std::char_traits<char>,std::allocator<char>>' (or there is no acceptable conversion) (12)
私は正直に私はこの問題を解決する方法がわからない文字列/ベクトルを出力に問題がなかったです。誰かが私にこれを修正する方法を教えてもらえますか?あなたがコードに何が間違っているのかを教えてもらえると素晴らしいでしょう。
#include "stdafx.h"
#include <iostream>
#include <vector>
using namespace std;
int main()
{
vector<string>hello;
hello.push_back("9");
for (auto i : hello)
cout << i << " "; <-- The first operator is underlined. Why?
return 0;
}
これはC++であり、Cタグは含みません! – tilz0R
''を含むようにしてください –
@JakubGawełインクルードヘッダー –