今天在编译 g++ test.cpp -o test 时候,系统老提示
test.cpp: In function ‘int main()’:
test.cpp:122: error: invalid operands of types ‘double’ and ‘double’ to binary ‘operator^’test.cpp:123: error: invalid operands of types ‘double’ and ‘double’ to binary ‘operator^’
test.cpp:139: error: invalid operands of types ‘double’ and ‘double’ to binary ‘operator^’
test.cpp:140: error: invalid operands of types ‘double’ and ‘double’ to binary ‘operator^’
这句话有问题,C++没有强大到A^2=A*A
dfaOutputXY[uiXX][uiYY].x=-(double)(sqrt(dfRadius^2-(ADOutputY[uiYY])^2))*((double)cos(dfTMP1));
改正后:
dfaOutputXY[uiXX][uiYY].x = -sqrt(dfRadius*dfRadius-ADOutputY[uiYY]*ADOutputY[uiYY])*cos(dfTMP1);
编译通过~~~