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


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM