I am trying to solve the following issue but could not succeed yet:
I have a two-diwmensional array of pointers:
int* a[16][128];
Now I want to make a pointer to this array in that way that I can use pointer arithmetic on it. Thus, something like this:
ptr = a;
if( ptr[6][4] == NULL )
ptr[6][4] = another_ptr_to_int;
I tried already some variations but it either fails then on the first line or on the if condition.
So, how can it be solved? I would like to avoid template classes etc. Code is for a time critical part of an embedded application, and memory is very limited. Thus, I would like ptr
to be only sizeof(int*)
bytes long.