c语言中指向整型指针的指针的理解
1 /************************************************************************* 2 > File Name: ptr_ptr_int.c 3 > Author: Mr.Yang 4 > Purpose:演示指向整型的指针的指针 5 > Created Time: 2017年06月03日 星期六 18时34分58秒 6 ************************************************************************/ 7 8 #include <stdio.h> 9 #include <stdlib.h> 10 11 int main(void) 12 { 13 int s[] = {1,2,3,4}; 14 int *p = s; 15 int **point = &p; 16 17 printf("s = %d\n",s); 18 printf("s[0] = %d\n",s[0]); 19 printf("p = %d\n",p); 20 printf("*p = %d\n",*p); 21 printf("*point = %d\n",*point); 22 printf("**point = %d\n",**point); 23 24 return 0; 25 }
执行结果:
1 s = 16519008 2 s[0] = 1 3 p = 16519008 4 *p = 1 5 *point = 16519008 6 **point = 1
由结果可知,**point = *p = s[0] *point = p = s