const理解

     const int * a4 = &a1;   ///const data,non-const pointer
     int * const a5 = &a1;   ///non-const data,const pointer
     int const * const a6 = &a1;   ///const data,const pointer
     const int * const a7 = &a1;   ///const data,const pointer

const用来修饰类型,const对其左边所有的类型起作用,对右边最少的类型起作用
posted @ 2018-10-26 09:27  mingzhang  阅读(169)  评论(0编辑  收藏  举报