#include <stdio.h>
int main() {
int a[]={1, 2, 4, 8};
int *p = a; //p 포인터 변수가 a를 가리킴
p[1]=3; //a배열 1번 방 2를 3으로 변경
a[1]=4; //a배열 1번 방 3을 4로 변경
p[2]=5; //a배열 2번 방 4를 5로 변경
printf("%d %d\n", a[1]+p[1], a[2]+p[2]); //a[1] 8출력, a[2] 10출력
return 0;
}
To embed this project on your website, copy the following code and paste it into your website's HTML: