码迷,mamicode.com
首页 > 编程语言 > 详细

c语言中指向整型指针的指针的理解

时间:2017-06-03 20:07:15      阅读:237      评论:0      收藏:0      [点我收藏+]

标签:void   style   color   main   blog   time   create   执行   指针的指针   

 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

c语言中指向整型指针的指针的理解

标签:void   style   color   main   blog   time   create   执行   指针的指针   

原文地址:http://www.cnblogs.com/yanglai/p/6938179.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!