• 认真地记录技术中遇到的坑!
  • 能摸鱼真是太好啦!嘿嘿嘿!

2019年02月25日的内容

C/C++

C++中const,int,*定义变量时不同顺序的含义

C++中const,int,*定义变量时不同顺序的含义
在C++中,经常容易忘记const int *a和const *int a的区别,其实主要是看const后面修饰的是哪一个类型,以离const最近的为基准即可。 const int *a 离const最近的是int,const修饰的是int,而int声明一个整型变量。等价于int const *a。 所以const int *a表示声明一个指向常量整数的整型……继续阅读 »

悠悠 5年前 (2019-02-25) 4031浏览 0评论 2个赞