#include <stdio.h>
void main() {
int nums[5]={11,22,33,44,55};
int *ptr=nums+1; //ptr이 가리키는 부분 : {22}
int i;
for(i=0; i<4; i++) //i=0~3까지
printf("%d ", *ptr++); // {22,33,44,55}
return 0;
}
//추가
*ptr++ → *(ptr++) // 값 사용 후 ptr 증가
(*ptr)++ → 가리키는 값 증가
*++ptr → *(++ptr) // ptr 먼저 증가 후 값 사용
To embed this project on your website, copy the following code and paste it into your website's HTML: