[Private Notes]: C++

pointer:

int a = 12;
int *p = &a;
cout << p <<endl;

输出:00B6F734
//****************************************
//****************************************

cout << *p <<endl;
输出:12

const modified pointer—————constant pointer

const int *p = &a;

The address can be changed, but the content cannot be changed

const modified constant————pointer constant

int * const p = &a;

The address cannot be changed, but the content can be changed

const modified constants and pointers——————

const int * const p = &a;

The address cannot be changed, the content cannot be changed

Guess you like

Origin blog.csdn.net/qq_42792802/article/details/126593724