#include <stdio.h>

int main() {
    int a = 10, b=20;
    int *p=NULL;

    p=&a;
    
    printf("a의 값 : %d\n" ,a);
    printf("a의 주소 : %p\n" ,&a);
    printf("p의 값 : %p\n" ,p);
    printf("p의 주소값이 가리키는 데이터 : %d\n\n" ,*p);

    p=&b;
    printf("b의 값 : %d\n" ,b);
    printf("b의 주소 : %p\n" ,&b);
    printf("p의 값 : %p\n" ,p);
    printf("p의 주소값이 가리키는 데이터 : %d\n\n" ,*p);

    int c = 10;
    int *pc=NULL;

    pc=&c;
    
    printf("c의 값 : %d\n" ,c);
    printf("pc의 값 : %d\n" ,*pc);
    *pc=20;
    printf("pc의 값 변경 : %d\n" ,*pc);
    printf("c의 값 : %d\n" ,c);
    return 0;
}

Embed on website

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