#include <iostream>#include<string>using namespacestd;intMain () {Char*a="123"; Char*b="456"; Char*d="789"; Char**c=&A; cout<<static_cast<Const void*> (a) <<endl<<static_cast<Const void*> (*c) <<Endl; //cout<<a<<endl<<c<<endl;*c=b; cout<<static_cast<Const void*> (a) <<endl<<static_cast<Const void*> (*c) <<Endl; //cout<<a<<endl<<c<<endl;a=D; //cout<<a<<endl<<c<<endl;cout<<static_cast<Const void*> (a) <<endl<<static_cast<Const void*> (*c) <<Endl; return 0;}
1 pointers we usually use "sequential use" to pay a pointer value to the address of a function or variable. This use of the two-level pointer is also consistent with the characteristics of the pointer, the pointer value changes and the value of the variable associated with it, but it is necessary to remember that the pointer variable operation is the variable itself, the analysis is not disturbed by ' * '.
2 This small example also demonstrates the "reverse use" of pointers, the associated variable changes, and the pointer changes as well.
This feature is also applicable when referenced in C + +.
C + + pointer base usage