首页 > 编程语言 > 详细

c语言中对指向指针的指针的理解?

时间:2017-06-02 10:56:08      阅读:296      评论:0      收藏:0      [点我收藏+]
 1 /*************************************************************************
 2     > File Name: ptr_to_ptr.c
 3     > Author: Mr.Yang
 4     > Purpose:演示指向指针的指针 
 5     > Created Time: 2017年06月02日 星期五 09时17分45秒
 6  ************************************************************************/
 7 
 8 #include <stdio.h>
 9 #include <stdlib.h>
10 
11 int main(void)
12 {
13         int myvar = 12;
14 
15         int *ptr;
16         ptr = &myvar;
17 
18         /*
19         int **ptr_to_ptr;
20         *ptr_to_ptr = &ptr;//怎么实现指向指针的指针的运用?此种方法证明不正确,为什么? 
21         */
22 
23         int **ptr_to_ptr = &ptr;//实现指向指针的指针的运用,必须这样使用么?
24 
25         printf("%d\n",**ptr_to_ptr);
26         //思考可以用puts么,为什么?
27         //puts(ptr_to_ptr);
28 
29         return 0;
30 }

 

c语言中对指向指针的指针的理解?

原文:http://www.cnblogs.com/yanglai/p/6931829.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!