const and basic type

int x =3;//变量
const int x =3;//常量

const and ponint type

一重指针

1、const int *p =null ;等价于 int const *p=null;
c++远航之const

const 修饰的是 *p 不能动

2、int* const p=null;
c++远航之const

const修饰指针p 即p是常量且唯一,不能再指向其他地址

3、const int *const p =null;
等价于
int const *const p =null;
c++远航之const

p和*p都不能动

相关文章:

  • 2021-12-27
  • 2021-12-19
  • 2021-11-12
  • 2021-10-04
  • 2021-07-18
  • 2021-10-21
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-07-25
  • 2021-05-25
  • 2022-02-15
  • 2022-01-31
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案