#include <stdio.h>
void Swap(int **dp1, int **dp2)
{
int *temp = *dp1;
*dp1 = *dp2;
*dp2 = temp;
}
int main(void)
{
int a = 10;
int b = 20;
int *c = &a;
int *d = &b;
printf("첫 결과: a: %d b: %d\n", a
, b
);
pointer2(&c,%d);
printf("최종결과 after a: %d b: %d\n", a
,b
); return 0;
}
I2luY2x1ZGUgPHN0ZGlvLmg+Cgp2b2lkIFN3YXAoaW50ICoqZHAxLCBpbnQgKipkcDIpCnsKCWludCAqdGVtcCA9ICpkcDE7CgkqZHAxID0gKmRwMjsKCSpkcDIgPSB0ZW1wOwp9CgppbnQgbWFpbih2b2lkKQp7CglpbnQgYSA9IDEwOwoJaW50IGIgPSAyMDsKCWludCAqYyA9ICZhOwoJaW50ICpkID0gJmI7CgoJcHJpbnRmKCLssqsg6rKw6rO8OiBhOiAlZCBiOiAlZFxuIiwgYSwgYik7CgoKCXBvaW50ZXIyKCZjLCVkKTsKCXByaW50Zigi7LWc7KKF6rKw6rO8IGFmdGVyIGE6ICVkIGI6ICVkXG4iLCBhICxiKTsKCXJldHVybiAwOwp9Cg==
prog.c: In function ‘main’:
prog.c:20:2: warning: implicit declaration of function ‘pointer2’ [-Wimplicit-function-declaration]
pointer2(&c,%d);
^~~~~~~~
prog.c:20:14: error: expected expression before ‘%’ token
pointer2(&c,%d);
^
prog.c:15:7: warning: unused variable ‘d’ [-Wunused-variable]
int *d = &b;
^