[table]
|指针特性|有两面性| |
|指针常量|int* const p = 2;|const 更靠近p,修饰p的值不可更改,而p指向的内容可改|
|常量指针|const int *p = 1;|const修改*p,p指向的内容不可更改|
[/table]
[table]
|const vector<int> v;|
|const vector::iterator ix = vec.begin();|
|vector::const_iterator ix = vec.begin();|
[/table]
|指针特性|有两面性| |
|指针常量|int* const p = 2;|const 更靠近p,修饰p的值不可更改,而p指向的内容可改|
|常量指针|const int *p = 1;|const修改*p,p指向的内容不可更改|
[/table]
[table]
|const vector<int> v;|
|const vector::iterator ix = vec.begin();|
|vector::const_iterator ix = vec.begin();|
[/table]