#include <stdio.h>
void print_r(int a[], int n);
int main(void){
    int a[] = {10,20,30,40,50};
    print_r(a, 5);
    return 0;
}
void print_r(int a[], int n){  //n=5
    int *p = a+1;  //*p =a배열 첫번째 칸+1칸 이동!!! =20 
    while(p>=a)  
        printf("%d\n", *p--);
        //11>=a  이때, a=10이다. 20이 더 크니까, printf()
        //*p-- 는 20을 가리킴   20 출력
        //10>=a  이때, a=10이다. 둘 다 10으로 같으니까, printf()
        //*p-- 는 10을 가리킴   10 출력
        //이후 p >=a가 거짓이니까 반복 종료!
}

Embed on website

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