Mixing Array Indexing and Pointer Dereferencing
#include <stdio.h>
main()
{
int q[3][3] =
{{0,1,2},{3,4,5},
{6,7,8}};
printf("%d %d %d %d\n",
q[1][2],
*(q[1]+2),
*( (*(q+1) + 2) ),
*(&q[0][0] + 5) );
}
Prints:
5 5 5 5
This is program
ex8.c
Previous slide
Next slide
Back to first slide
View graphic version