#include <stdio.h>
#include <stdlib.h>
int g(int* p){
    *p=p[1]+20;
    p++;
    int ans = *p;
    p[0]=456;
    return ans;
}
int f(int* q, int** p) {
    *q=99;
    int n=g(*p);
    printf("**p = %d\n", **p);  //ㄱ
    *p = q;
    return n;
}
int main(void){
    int a = 4;
    int b[] = {6,9,88};
    int* p = &b[1];
    int c=f(&a, &p);
    printf("c = %d\n", c);  //ㄴ
    if(p == &a){
        printf("*p aliases a, both = %d\n", *p);
    }
    else {
        printf("*p is %d\n", *p);
        printf("a is %d\n", a);
    }
    for(int i=0; i<3; i++){
        printf("%d ", b[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: