Multi-dimensional arrays and pointers
#include <stdio.h>
void main()
{
int i = 0; /* Loop counter */
char t[3][3] = {
{'1','2','3'},
{'4','5','6'},
{'7','8','9'}
};
char *pointer = *t; /* A pointer to char */
for(i = 0; i < 9; i++)
printf(" t: %c\n", *(pointer + i));
}
Related examples in the same category