本文共 464 字,大约阅读时间需要 1 分钟。
so the conclusion is : the function been call's input parameter is pointer address.
#include <stdio.h> void fun0 (char a[]) { char c = a[1];//或者是 char c = *(p+3); printf("c is : %c\n",c); }
void fun1 (char *p) { char v = p[1];//或者是 char c = *(p+3); printf("v is : %c",v); }
int main () { char *p2 = "abcdefg"; fun0(p2); fun1(p2); return 0; }
//end is same (c) //so the conclusion is : the function been call's input parameter is pointer address.(函数传参传入的是指针地址,不传数组)
转载地址:http://pdtgf.baihongyu.com/