C/C++ 中 const int*,const int * const 和 int const * 之間的區別?
以上符號的含義如下 −
int* - Pointer to int. This one is pretty obvious. int const * - Pointer to const int. int * const - Const pointer to int int const * const - Const pointer to const int
還要注意如下內容 −
const int * And int const * are the same. const int * const And int const * const are the same.
如果你在閱讀這些符號時遇到混淆,請記住螺旋規則:從變數的名稱開始,順時針移動到下一個指標或型別。重複此過程,直到表示式結束。
廣告