const关键字

Posted 大飞歌

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了const关键字相关的知识,希望对你有一定的参考价值。

1》修饰基本类型变量(使其只读)

 

2》修饰指针:

  ①、int const *p或者const int *p;

    *p是只读的,不可以通过指针修改,可以通过变量修改;

  ②、int * const p;

    const将p变为只读数据

  ③、const int * const p;

     const将p和*p都变为只读数据

以上是关于const关键字的主要内容,如果未能解决你的问题,请参考以下文章

Round B APAC Test 2016

UTXO团队赴澳出席Blockchain APAC会议

ant jmeter jenkins 实现自动化测试

共享目录磁盘,apace+php搭建ecshop

apace访问403错误的解决方法汇总

2017 google Round C APAC Test 题解