You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
LearnCCpp/basic/3_pointer.c

16 lines
363 B

#include <stdio.h>
int main()
{
int a = 10;
int *p = &a; // p는 a의 주소를 저장
// &: 변수의 주소
// *: 주소에 저장된 값
printf("Value of a: %d\n", a);
printf("Address of a: %p\n", (void*)&a); // void*: 일반 포인터
printf("Address of a: %x\n", p);
printf("Pointing value of p: %d\n", *p);
return 0;
}