I am getting confused again by the pointer principle.
I have the following two arrays a and b:
int16_t a[3][2] = { {30, 40}, {31, 41}, {32, 42} }; int16_t b[3][2] = { {50, 40}, {51, 41}, {52, 42} }; The second column of b shall always be equivalent to the second column of a. So whenever a changes on the second column (e.g. 40 getting 60), this should be represented in b as well.
So I am looking for something like that using a pointer but could not make it work:
int16_t a[3][2] = { {30, 40}, {31, 41}, {32, 42} }; int16_t b[3][2] = { {50, (*a[0][1])}, {51, (*a[1][1])}, {52, (*a[2][1])} }; I am not too familiar with the pointer principle. Any suggestions?
bare still 16-bit integers. You can't do any kind of pointer magic to make them always followa. Not like this, anyway. Is there anything wrong with just keeping them in sync? That really will be the easiest thing to do.