Mega Code Archive

 
Categories / C / Code Snippets
 

Two-Dimensional arrays and pointers

#include <stdio.h> void main() { char twoD[3][3] = { {'6','8','2'}, {'1','4','8'}, {'3','8','1'} }; printf("address of twoD : %p\n", twoD); printf("address of twoD[0][0] : %p\n", &twoD[0][0]); printf("but what is in twoD[0] : %p\n", twoD[0]); }