-4
Cout(以及我在返回後嘗試放置的所有其他東西)在放入此函數後不起作用。怎麼了?Cout在返回後不起作用
float tanDegrees() {
string i;
double iDouble;
string choice;
cout << "Give me a number to find the value of degrees in. ";
getline(cin, i);
iDouble = stod(i);
double PI = 3.14159265359;
float answer = tan((PI/180)*iDouble);
cout << "Test!" << endl;
return answer;
cout << "Test!" << endl;
}
我想使用「答案」值來創建另一個值,這兩個我想在功能完成運行後使用。我是否應該將這兩個人的回報放在函數的最後? – Rocky
@Rocky那麼你應該在返回tanDegrees()之後使用該值,而不是函數本身。 – Joel