void searchFlight(cust flights[] ,int row)
{
clrscr();
cout << "Search for the flight you are looking for.\n";
string airport;
cout << "Enter Departing Flight : ";
cin >> airport; //error
for (int r=0;r<row;r++)
{
if (strnicmp(airport, flights[r].airport[20], strlen(airport) ==0) //error
{
clrscr();
cout << flights[r].name[20] <<endl;
cout << flights[r].airport[20] <<endl;
cout << flights[r].destination[20] <<endl;
cout << flights[r].ticket <<endl;
cout << flights[r].passangers <<endl;
cout << flights[r].opCost <<endl;
cout << flights[r].income <<endl;
cout << flights[r].netProfit <<endl;;
pressKey();
}
}
pressKey();
}
cin エラーの場合: エラー C2678: バイナリ '>>' : タイプ 'std::istream' の左側のオペランドを取る演算子が見つかりません (または、受け入れ可能な変換がありません)
strnicmp エラーの場合: エラー C2664: 'strlen': パラメーター 1 を 'std::string' から 'const char *' に変換できません
この問題の解決策を探しましたが、修正できませんでした。私の問題を解決できる同様の投稿がここにある場合は、お詫び申し上げます。