#include <stdio.h>

void main() {
    short x[2][2]={{1, 2}, {3, 4}};          //short을 이용해 2바이트씩 증가
    short *px[2];                            
    short **ppx;
    px[0]=x[0]; px[1]=x[1];                  //px[0]은 x[0][0], px[1]은 x[1][0]
    ppx=px;                                  //px[0]을 가리킴
    
    for (int i=0; i<2; i++){
        for (int j=0; j<2; j++)
        printf("%p\t", &x[i][j]);
        printf("\n");
    }
        printf("%p %p %p\t", &px[0], &px[1], &ppx);
        printf("\n");
        printf("\n");
        printf("\n");

    printf("%p %p %p\n", px[0], px[1], ppx);          
    //x[0][0]을 p[0]가리키는 주소, x[1][0]을 p[1]가리키는 주소, px의 주소 
    
    printf("%p %p %p\n", px[0]+1, px[1]+1, ppx+1);  
    //x[0][1]의 주소, x[1][1]의 주소, px[1]의 주소
    
    printf("%d %d\n", *(++px[0]), **(++ppx));
    //px[1]의 값, px[1]의 값
}

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: