我有以下代碼:我不知道問題是什麼。它強調了for循環中的cout之後的'< <'。列表迭代器錯誤C++
#include <fstream>
#include <sstream>
#include <ostream>
#include <istream>
#include <string>
#include <iostream>
#include <iterator>
#include <list>
list<weatherStation> station;
weatherStation *aStation;
aStation = new weatherStation();
for (list<weatherStation>::iterator it = station.begin(); it != station.end(); ++it)
{
cout << *it << endl;
}
我發現了錯誤是:
錯誤2錯誤C2679:二進制「< <」:沒有操作員發現它採用類型「氣象站」的 右邊的操作數(或沒有可接受的 轉換)\ zorak2 \用戶$ \ s0941625 \我的文檔\ Visual Studio的 2013 \項目\ lentzis \ lentzis \ newmain.cpp 100 1 PROJECT1
和
3智能感知:沒有運營商 「< <」 這些操作數 操作數類型匹配:性病:: ostream的< <氣象站\ zorak2 \用戶$ \ s0941625 \我的文檔\ Visual Studio的 2013 \項目\ lentzis \ lentzis \ newMain.cpp 101 10 PROJECT1
即時消息不知道你的定義是什麼意思? –
由於沒有定義'weatherStation',所以編譯器不會很快就開始抱怨。 –