I came across the below code snippet in a project and was not sure how value of variable "response" is computed. Here as we can see, pic_data holds two one dimensional arrays but "response" access both the single dimensional array as two dimensional array. Can anyone please explain how this works?
Code:#define MAX 100 #define MAXBUF 100 u32 response; u32 index; typedef struct { u16 flag; u16 status; } __attribute__ ((packed)) register; typedef struct{ register *rq[MAX]; u64 buf[MAXBUF]; }Data; Data *pic_data; void getres(Data *pic_data) { response = *((u32*)&(pic_data->rq[index][pic_data->buf[index]])); }