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

 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 }

 

posted @ 2017-06-02 09:31  杨来  阅读(370)  评论(0编辑  收藏  举报