Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/cplusplus/131.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C++ 警告:条件的第二个/第三个操作数无效[-Wunused value]_C++_Gcc_Operator Precedence - Fatal编程技术网

C++ 警告:条件的第二个/第三个操作数无效[-Wunused value]

C++ 警告:条件的第二个/第三个操作数无效[-Wunused value],c++,gcc,operator-precedence,C++,Gcc,Operator Precedence,怎么了?您的代码转换为: second operand of conditional expression has no effect [-Wunused-value] third operand of conditional expression has no effect [-Wunused-value] 或 我的意思是std::cout second operand of conditional expression has no effect [-Wunused-value] thir

怎么了?

您的代码转换为:

second operand of conditional expression has no effect [-Wunused-value]
third operand of conditional expression has no effect [-Wunused-value]

我的意思是
std::cout
second operand of conditional expression has no effect [-Wunused-value]
third operand of conditional expression has no effect [-Wunused-value]
((std::cout << (abs(b - c) < a)) && a < b + c) ? 1 : 0;
std::cout << (abs(b - c) < a && a < b + c ? 1 : 0);
// same as std::cout << ((abs(b - c) < a && a < b + c) ? 1 : 0);
std::cout << (abs(b - c) < a && (a < b + c ? 1 : 0));
std::cout << (abs(b - c) < a && a < b + c);