当前位置:网站首页>关于常量指针、指针常量的使用--练习题(记录)
关于常量指针、指针常量的使用--练习题(记录)
2022-04-22 05:44:00 【What’smean】
常量指针:
定义: 常量指针本质上是个指针,只不过这个指针指向的对象是常量。
声明: int const * a; 或 const int * a;
注:const int i=3; int const * a=&i; const int j = 4; a=&j; //合法
常量指针指向的对象不能通过这个指针来修改,但是因为常量指针本身是一个变量,因此,可以被重新赋值。
指针常量:
定义: 指针常量的本质上是个常量,只不过这个常量的值是一个指针。
声明: int * const a;
注:const int i=3; int * const a= &i; *a = 4; //合法
指针常量的值是指针,这个值因为是常量,所以指针本身不能改变。但是,指针的内容可以改变。

版权声明
本文为[What’smean]所创,转载请带上原文链接,感谢
https://blog.csdn.net/weixin_42492218/article/details/124131970
边栏推荐
猜你喜欢

Part 73 leetcode exercise (6) 6 Zigzag transformation

Jeecgboot online form development - control configuration

Write an article about DDT data-driven automated testing

Access problems after setting up the local server

蓝桥杯嵌入式扩展板学习之DS18B20

MODBUS协议简记

Installation of QT learning

IWDG

Part 85 leetcode sword refers to offer dynamic programming (II) frog jumping steps

deep learning object detection
随机推荐
c#catch错误信息自定义显示
Installation of QT learning
Jeecgboot online development 3
jeecgboot-online表单开发-控件配置
The Localtime function affects performance
Universal timer
蓝桥杯嵌入式扩展板学习之ADC按键
Part 90 leetcode refers to the longest substring of offer dynamic programming (VII) that does not contain duplicate characters
自动获取指定路径文件夹,删除文件夹及子文件
I/O多路复用(select/poll/epoll)
Chapter 88 leetcode sword refers to offer dynamic programming (V) maximum value of gifts
Speed measurement based on 51 single chip microcomputer and Hall sensor
Daily learning record -- solving graphviz Chinese garbled code problem
deep learning object detection 精选
机器人工具坐标系标定原理
Pykmip test
qt.qpa.plugin: Could not find the Qt platform plugin “xcb“ in ““
Chapter 89 leetcode refers to offer dynamic programming (6) translating numbers into strings
stm32单片机与LD3320语音模块交互法一
Part 73 leetcode exercise (6) 6 Zigzag transformation