#include <stdio.h>

int main() {
    int arr[5]={5,10,2,9,1};

    printf("arr의 주소; %p\n",arr);

    for(int i=0;i<5;i++){
        printf("arr[%d]의 주소: %p\n", i, &arr[i]);
    }

    printf("\n");
    
    int hide[3]={5,10,2};
    int *nut=hide;

    printf("\n하이드의 군대\n");
    for(int i=0;i<3;i++){
        printf("%d군단의 주소:%p\n", i, hide+i);
        printf("병사의 수: hide[%d}: %d, *(hide+%d):%d\n", i, hide[i],i,*(hide+i));
    }
    
    printf("\n넛이 보는 지원군\n");
    for(int i=0;i<3;i++){
        printf("%d군단의 주소:%p\n", i, nut+i);
        printf("병사의 수: nut[%d}: %d, *(nut+%d):%d\n", i, nut[i],i,*(nut+i));
    }
    
    
    
    
    
    
    
    
    
    
    
    
    
    return 0;
}

Embed on website

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