I'm having the following error at the following line:
if( ( (res >> i*8) ^ cmp[i] ) != 0x00)
the error is:
error: invalid operands of types 'void*' and 'int' to binary 'operator>>'|
res is of type void*
i is of type int
cmp is of type char*
all variables have the required space allocated.
Can you please help me figure out what's wrong?
Last edited on
You can't use bit operations on pointers. What exactly are you trying to do?
Oh, sorry, i didn't knew... Thanks for the info.
Maybe it's something like one of those xor linked lists?
Anyway, to compile that,
if( ( (reinterpret_cast<std::uintptr_t>(res) >> i*8) ^ cmp[i] ) != 0x00)
If you don't have uintptr_t (it comes from cstdint in C++11 and from stdint.h in C99), size_t will likely work as well.
Last edited on