0
我有一个简单的问题,可能是小学。错误传递字符串
我经由浮子function
传递string
和我有以下错误
float formel(float K, float N, float H1, float H2, float L, float G, String^ Kop)
{
float temp1, temp2, temp3, temp4, temp5, temp6;
temp1 = L*(1.86f + G);
temp2 = 0.76f*temp1*(H2 - H1);
temp3 = 0.325f*K*(0.81f - H1);
temp4 = N*(temp2 + temp3);
temp5 = 0.042f*temp4;
if (Kop == "stand")
{
temp6 = temp5 * 0.047f*K;
}
else
{
temp6 = temp5;
}
return temp6;
}
和误差
错误C2061:语法错误:识别符 '字符串'
水晶球说你缺少'using namespace System;'指令。改用'System :: String'。或者使用'const char *',对于这段代码似乎更合适一些。 –
@HansPassant非常感谢。这解决了我的问题。 'System :: String^Kop' – Royeh