Hi, I have a pointer to an array and i am unable to access the members of the array.To make it more precise,plz see the code below:
int struc[2] = {6,7};
int (*Myval)[2];
Myval =&struc;
Now the Myval is pointing to the start of the array and upon dereferencing the pointer we would get the 1st element of the array i.e
printf("The content of the 1st element is %d\n",(*Myval[0]));
gives me the first elemnt which is 6.
How would i access the 2nd elemnt of the array using the same pointer.
If i would do Myval++,it would increment by 8 since the size of the array is 8. any suggestions or idea??
Thanks and regards Maddy