1#include <stdio.h>2 3 intMain ()4 {5 intA = -;6 intb = -;7 8 /*9 * Constant pointer, can not modify point to addressTen * The value in the storage space, but you can modify the value pointing to the address One */ A int Const*P1 = &A; - Const int*P2 = &a;//constant Pointer - the /* - * Pointer constant, can not modify the address pointed to - * But you can modify the contents of the point in the address storage space - */ + int*ConstP3 = &b; - + /* A * Constant pointer constant, the address pointed to and the value in the storage space at * Can not be modified - */ - Const int*ConstP4 = &A; - int Const*ConstP5 = &b;//constant Pointer Constants - - inP1 = &b;//constant pointer, you can modify the address pointed to -P2 = &b;//constant pointer, you can modify the address pointed to to +*P3 =Ten;//pointer constants, you can modify the contents of the storage space - //P3 = &a;//pointer constant, cannot modify the address pointed to the * //P4 = ten;//pointer constant, can not modify the point to address but can modify the point in the address storage space content $ //P5 = &a;//pointer constant, can not modify the point to address but can modify the point in the address storage space contentPanax Notoginseng -printf"%d %d%d%d%d", *p1, *P2, *P3, *P4, *p5); the + return 0; A}
Constant pointer, pointer constant, constant pointer constant