C/C++

C or C++ : Arithmetic operation on boolean

Overview

Arithmetic operations will not act in the same way on boolean values as they would on integral values, which may lead to unexpected behavior.

Special logical operators are used for operations with boolean variables:

  • logical negation (NOT) - !a;
  • logical AND - a&&b;
  • logical OR - a||b. .
LOW

DerScanner Severity Score

Check your C/C++ code for this vulnerability, free

Request a free pilot of DerScanner. We give you access and help with the first scan. It works in the cloud and on-premise.

Try it on your code, free

By submitting this form, I acknowledge that DerScanner may process my personal data I provided above for purposes explained above. More details about the processing.