我在UNIX終端運行此程序,但是當我嘗試編譯它給出了一個巨大的問題清單,但是我相信這個問題是部分說敵不過運營>>。我知道程序中遺漏了很多它不是接近完成,我想能夠編譯它,我雖然走更遠了。我不知道是什麼導致這個錯誤的任何幫助,不勝感激。不匹配運營商>>問題
#include <iostream>
#include <vector>
#include <string>
using namespace std;
int main()
{
int ui = 0 ;
vector<string> in;
string temp = "0";
int vsize = 0;
while(ui != 5)
{
cout << "1. Read" << endl;
cout << "2. Print" << endl;
cout << "3. Sort" << endl;
cout << "4. Search" << endl;
cout << "5. Quit" << endl;
std::cin >> ui >> std::endl;
if(ui = 1)
{
while(temp != "q")
{
std::cout << "Enter the next element (Enter 'q' to stop):" << std::endl;
std::cin >> temp >> std::endl;
in.pushback(temp);
vsize++;
}
}
if(ui = 2)
{
std::cout << "Sequence: ";
for (int i = 0; i < vsize; i++)
{
cout << in[i];
}
std::cout << std::endl;
}
if(ui = 3)
{
}
}
return 0;
}
'std :: cin >> temp >> std :: endl;'你是否試圖將數據讀入'endl'? – John3136
請在發佈時提供相關信息。這包括*完整的錯誤信息*。 –
*「......我希望能夠在我進一步深入之前編譯它......」*良好的直覺;你應該在沒有任何警告的情況下編譯它,然後再進一步*你甚至可以退到一個更簡單的版本,直到你解決這個問題。 – Beta