suggest parentheses around comparison in operand of &|

时间:2023-03-09 04:28:13
suggest parentheses around comparison in operand of &|

error discription:

.cpp::: warning: suggest parentheses around comparison in operand of ‘&’ [-Wparentheses]
if (data_cur[j] == & data_pre[j] == ) temp.at<uchar>(i, j) =

why:

该警告希望你在&(逻辑与)表达式左右加上括号。有的时候&&(逻辑且)少写了一个&,也会产生该警告。

因为&运算符的优先级较低,低于==和!=运算符。

if ( (data_cur[j] == ) && (data_pre[j] == ) ) temp.at<uchar>(i, j) = ;

RE

1.cnblogs-here;

End