Let's suppose I have a buffer of bytes:
char buffer[] = { 0x11, 0x00, 0x00, 0x02, .... };
What I want to do is to take a qword from a specific offset. The offset will be calculated in bytes. Here is what I have done:
unsigned long long *ptr = &buffer[16];
unsigned long long myqword = *ptr;
It seems to works for me. I am skipping 16 bytes from the beginning and then taking 8 bytes.
My question is why do I get this warning message:
warning: initialization of ‘long long unsigned int *’ from incompatible pointer type ‘char *’ [-Wincompatible-pointer-types]
unsigned long long *ptr = &buffer[16];