我試着用盡可能多的方式重新定義這些變量 試圖讓這一行起作用。在這裏我只舉一個例子 來表示困擾我的事情。使用if語句的C++字符串變量
double const FRAME_COST = 45.00;
string input;
char yes,
no;
int frames;
cout << "Do you want additional frames? Type yes/no: ";
cin >> input;
if (input == yes){
cout << "How many?"
cin >> frames;
frames = frames * FRAME_COST;
}
// The problem is in **the if statement**
// I need to use a string not a bool (according to my professor)
// I can't get the compiler to recognize the **if statement**
// I realize this isn't practical, but he always throws curve balls.
謝謝。我現在知道了。 – judonomi