My code below gives me a warning:
warning: assignment makes integer from pointer without a cast":
uint16_t b[4];
uint16_t *g_00;
uint16_t *g_01;
uint16_t *g_10;
uint16_t *g_11;
b[0] = g_00;
b[1] = g_01;
b[2] = g_10;
b[3] = g_11;
printf ("add = %x\n", b[0]);
I meant to use b[0]... b[1] to save the address of uint16_t *g_00;
How can I fix this compiler warning?
bto save an address it will need to be the size of an address. Not sure why you would not be using auint16_t*for b as well:uint16_t* b[4].uint16_t *g_00", it should beuint16_t **b[4]; if he wants to save the value ofuint16_t *g_00, it should beuint16_t *b[4]. If you wantbto save a pointer it will need to be an array of objects with the same type as the pointers, not just the same size as the pointers; except forvoid *s, C pointers aren't generic addresses, they're pointers to particular types.