const与指针类型

const int *p = NULL; int const *p = NULL; //彻底等价 int * const p = NULL //和上面两种状况不一样 const int * const p = NULL; int const * const p = NULL; int x = 3; const int *p = &x; //p=&y; 正确 //*p = 4; 错误 //因为
相关文章
相关标签/搜索