/* ============================================================================ Name : TestDoublePointer.c Author : lf Version : Copyright : Your copyright notice Description : 二级指针基础知识 ============================================================================ */ #include <stdio.h> #include <stdlib.h> void test(); int a=9527; int b=1313; int main(void) { test(); return EXIT_SUCCESS; } void test(){ printf("&a=%x\n",&a); printf("&b=%x\n",&b); printf("===========\n"); int *pa=&a; int **pp=&pa; //二级指针本身的地址 printf("pp=%x,\n",pp); //二级指针中保存的地址 printf("*pp=%x,\n",*pp); //根据二级指针取出内容 printf("**pp=%d\n",**pp); printf("===========\n"); testDoublePointer(pp); printf("**pp=%d\n", **pp); printf("pp=%x,\n", pp); printf("*pp=%x,\n", *pp); printf("**pp=%d\n", **pp); printf("===========\n"); } /** * 重新给二级指针赋值 */ void testDoublePointer(int **pp){ *pp=&b; }