C语言指针传参问题
#include <stdio.h>void fun(int a, int *bp, int **pa, int ***pb)
{
static int sum;
static int y = 10;
sum = a + *bp;
*pa = &y;
*pb = pa;//这个是啥意思啊。。。。? pa地址给*pb? 为什么写成pb=&pa就报错?
***pb = 300;
return;
}
int main(void)
{
int a = 100;
int b = 200;
int *p1 = NULL;
int **p2 = NULL;
fun(a, &b, &p1, &p2);
printf("*p1 = %d, **p2 = %d\n", *p1, **p2);
return 0;
}
代码如上,请各位大哥们详细解释下这个程序的传参问题。实参传入和形参完全不一样啊。。。那么在子函数中如何运行啊。。。。请各位大神们解答解答。。。。跪求