我有以下疑问:
I have a structure array. Before I had it initialized directly and was using in my code. But I was suggested to use pointers instead of direct structure. But I cannot get the pointer pointing to the array of structre properly.
typedef struct
{
int a;
int b;
} cqiReport;
cqiReport s_cqiReport[2][2];
cqiReport *ptr[2], *ptr2, *ptr3;
s_cqiReport[0][0].a=1;
s_cqiReport[0][0].b=1;
*ptr= s_cqiReport;
*ptr2= s_cqiReport[0][0];
*ptr3= s_cqiReport[1][0];
I get ptr[0] pointing to s_cqiReport[0][0] properly but ptr[2] points to some junk. How do i get ptr2[1] point to s_cqiReport[1][0]?
Please Help Thanks DSP guy