2. Use pow() from <math.h> (or std::pow() from <cmath>).
^ is bitwise XOR.

1. There is no bit wise operator. There's bitwise AND, bitwise OR and bitwise XOR, and any tutorial can tell you how to...