Why == works in an if statement?

Anyone know if > or < are valid comparison operators or is >> and << used instead?

< and > are the correct comparison operators as are >=, <=, and != (not equal to).

<< and >> are used as bit shifting operators. (1 << 3) is the digit 1 shifted to the right 3 binary positions (ie, 00000001 becomes 00001000), or 2^3 = 8 decimal.

The questions you are asking are answered very clearly if you look up a C++ reference for 'operators'.