As Breadman said, ^ is known as the XOR operator. it stands for Exclusive Bitwise OR operator.
It will consider the characters in binary form (well it considers everything in binary).
It will check the corresponding bits.
It will return 1 if the two digits are different, and return 0 if they are same.
So
1 ^ 0 = 1
0 ^ 1 = 1
1 ^ 1 = 0
0 ^ 0 = 0
It can be used for encryption.
If you want to calculate the Exponent:
The
cmath header file has the
pow() function (in the standard namespace).
It will take in two parameters, the first will be the Base and the second an Exponent.
So if you want to calculate 2^0:
pow(2.0, 0)
You will get further info here:
http://www.cplusplus.com/reference/clibrary/cmath/pow/