Tag: pointer C language level two pointer
/* ============================================================================ Name : TestDoublePointer.c Author : LF Version : Copyright : Your copyright Notice Description: Level two pointer Basics ============================= =============================================== */#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);p rintf ("&b=%x\n", &b);p rintf ("===========\n"); int *pa=&a;int **pp=&pa;//the address of the two-level pointer itself to printf ("pp=%x,\n", pp), and//two-level pointer to the saved address in printf ("*pp=%x,\n", *pp);//Remove the contents according to the two-level pointer printf ("**pp=%d\ n ", **pp);p rintf (" ===========\n "), Testdoublepointer (PP);p rintf (" **pp=%d\n ", **pp);p rintf (" pp=%x,\n ", pp);p rintf (" *pp=%x,\n ", *pp);p rintf (" **pp=%d\n ", **pp);p rintf (" ===========\n ");} /** * Re-assign value to level two pointer */void testdoublepointer (int **pp) {*pp=&b;}
Level two pointer basics