C Programming Code Examples C > Pointers Code Examples Pointers & 2D array in C programming Pointers & 2D array in C programming As we know that the one dimensional array name works as a pointer to the base element (first element) of the array. However in the case 2D arrays the logic is slightly different. You can consider a 2D array as collection of several one dimensional arrays. #include <stdio.h> int main() { int abc[5][4] ={ {2,4,6,8}, {10,12,14,16}, {18,20,22,24}, {26,28,30,32}, {34,36,38,40} }; for (int j=0; j<=4; j++) { /* The correct way of displaying an address would be * printf("%p ",abc[j]); but for the demonstration * purpose j am displaying the address in int so that * you can relate the output with the diagram above that * shows how many bytes an int element uses and how they * are stored in contiguous memory locations. * */ printf("%d ",abc[j]); } return 0; }