#include <stdio.h>

//배열은 메모리에 연속적으로 저장, 포인터 연산은 자료형 크기단위로 이동
//a[0]: 첫번째행 전체를 가르킴 -> 식에서 사용될때는 &a[0][0]으로 사용됨. 즉 첫번째 행의 첫번재 주소로 사용됨 

void main() {
    int a[2][3] = {{-3, 14, 5}, {1, -10, 8}};
    int *b[] = {a[0], a[1]}; //b[0] = &a[0][0], b[1] = &a[1][0],
    int *p = b[1]; //p = b[1] = &a[1][0]

    printf("%d, ", *b[1]); //&a[1][0] = 1
    printf("%d, ", *(--p - 2)); //--p = ^a[0][2] -> --p-2 = &a[0][0]: -3 
    printf("%d\n", *(*(a + 1) + 1)); //a + 1 = *(a[0]+1) = a[1] -> a[1][0]+1 -> *(a[1][1]) = 10
}

Embed on website

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