<<< Increment and Decrement Operators | Index | Logical operators short-circuiting >>> |
if ( exp1 && exp2 ) { //... } |
#include <cassert>
void main()
{
int x = 1;
int y = 2;
// true: y > x
// true: x > 0
if ( y > x && x > 0 ) {
assert( y > x );
assert( x > 0 );
}
}
|
if ( exp1 || exp2 ) { //... } |
void main()
{
int x = 1;
int y = 2;
if ( x == 1 || y == 2 ) {
//...
}
}
|
<<< Increment and Decrement Operators | Index | Logical operators short-circuiting >>> |