-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