一个关于多层指针的问题?
# include <stdio.h># include <malloc.h>
void f(int** p, int** q)
{
int* t;
t = *p;
*p = *q;
*q = t;
}
int main(void)
{
int a = 3;
int b = 5;
int* p;
int* q;
p = &a;
q = &b;
f(&p, &q);
printf("%d, %d", *p, *q);
return 0;
}
我这个程序是不是交换两个变量a和b的地址啊?