data.bytes
is a void *
, so it makes no sense to dereference it (or even to perform the necessary pointer arithmetic on it).
So, if you meant to take a byte out of the data, then obtain a pointer to const unsigned char
and dereference that:
const unsigned char *src = data.bytes;
/* ..then, in your loop.. */
bytes[i] = src[index];