I am trying to pass a pointer to a 3D array to a function in which I want to access an array element using pointer arithmetic.
Define the array:
const unsigned char TS_list_string[2][2][3] =
{
"abc", "def",
"ghi", "jkl",
};
Define the function
void process_ts(const unsigned char *T1)
{
unsigned char dv;
dv = *(*(*(T1 + 1) + 1) + 2); <----- Compiler error: "Operand of * must be a pointer
}
Main
int main()
{
const unsigned char *T1;
T1 = &TS_list_string[0][0][0];
process_ts( T1);
}
Does anyone know what I am doing wrong?