const

时间:2014-05-12 09:01:55   收藏:0   阅读:207

    const int i = 100;
    const int i2 = 200;

// const 在指针左边,   值为const
    const int * p = &i;
    int const * p2 = &i;

// const 在指针右边,   指针为const
    int a = 10;
    int* const p3 = &a ;

const,布布扣,bubuko.com

评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!