First page Back Continue Last page Graphics
! not
Note the strange logic in some of my examples in short.cpp. If ( exp ) ; else { };
This is hard to read.
It often is easier to reverse the expression by using the not operator.
if ( x < 12 ) ; else cout << “hi!”<< endl;
if ( ! (x < 12) ) cout << “hi!” << endl;
if ( x >= 12 ) cout << “hi!” << endl;
All three identical results.