程序:
cout << num1 ^ num2 << endl;
错误:invalid operands of types ‘int’ and ‘<unresolved overloaded function type>’ to binary ‘operator<<’
原因:<< 的优先级比 ^ 要高
解决:加括号变为 (num1 ^ num2)
程序:
cout << num1 ^ num2 << endl;
错误:invalid operands of types ‘int’ and ‘<unresolved overloaded function type>’ to binary ‘operator<<’
原因:<< 的优先级比 ^ 要高
解决:加括号变为 (num1 ^ num2)
本文标题:invalid operands of types ‘int’
本文链接:https://www.haomeiwen.com/subject/roknzftx.html
网友评论