多维数组与指针(一)

#include <stdio.h>

int main()
{
        const int foo[3][4] = 
        {   
                {11,12,13,14},
                {21,22,23,24},
                {31,32,33,34},
        };  

        for(int i=0; i<3; i++)
        {   
                for(int j =0; j<4; j++)
                {   
                        printf("%d		",foo[i][j]);
                        printf("
");
                        printf("%p	
",&foo[i][j]);
                }   
                printf ("
");
        }   
}
11		
0x104d43f30	
12		
0x104d43f34	
13		
0x104d43f38	
14		
0x104d43f3c	

21		
0x104d43f40	
22		
0x104d43f44	
23		
0x104d43f48	
24		
0x104d43f4c	

31		
0x104d43f50	
32		
0x104d43f54	
33		
0x104d43f58	
34		
0x104d43f5c	

foo = 0x104d43f30
foo + 1 = 0x104d43f40
foo[0] = 0x104d43f30
foo[0] + 1 = 0x104d43f34
*(foo[0] + 1) = 12
原文地址:https://www.cnblogs.com/yaos/p/7197849.html