It seems like I should be able to perform bit shift in C/C++ by more than 32 bits provided the left operand of the shift is a long. But this doesn’t seem to work, at least with the g++ compiler.
Example:
unsigned long A = (1L << 37)
gives
A = 0
which isn’t what I want. Am I missing something or is this just not possible?
-J
Re-try this using a variable of type
uint64_t(fromstdint.h) instead oflong.uint64_tis guaranteed to be 64 bits long and should behave as you expect.