当前位置:网站首页>On the use of constant pointer and pointer constant -- exercise (record)
On the use of constant pointer and pointer constant -- exercise (record)
2022-04-23 05:27:00 【What’smean】
Constant pointer :
Definition : A constant pointer is essentially a pointer , But the object pointed to by this pointer is a constant .
Statement : int const * a; or const int * a;
notes :const int i=3; int const * a=&i; const int j = 4; a=&j; // legal
The object pointed to by the constant pointer cannot be modified by this pointer , But because the constant pointer itself is a variable , therefore , Can be reassigned .
constant pointer :
Definition : A pointer constant is essentially a constant , But the value of this constant is a pointer .
Statement : int * const a;
notes :const int i=3; int * const a= &i; *a = 4; // legal
The value of a pointer constant is a pointer , Because this value is constant , So the pointer itself cannot be changed . however , The contents of the pointer can be changed .

版权声明
本文为[What’smean]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204220544124415.html
边栏推荐
- Ehcache Memcache redis three caches
- varnish入门
- What are the most popular recruitment technical skills in 2022? You can't think of it
- 2021-10-12
- [the background color changes after clicking a line]
- Uniapp hot update with progress bar
- Three of three JS (webgl) is simple to draw lines / arcs according to points (based on linegeometry / line2 / linematerial, draw two arc segments based on the center of the circle)
- 2021-09-28
- 使用宝塔+xdebug+vscode远程调试代码
- 开源规则引擎——ice:致力于解决灵活繁复的硬编码问题
猜你喜欢

JS array common methods

(11) Vscode code formatting configuration

What are the reasons for the failure of digital transformation?

Understand the relationship between promise async await

Three of three JS (webgl) simple sorting of rotation attribute function, and a simple case of rotating around the axis based on this

Open source rule engine - Ice: dedicated to solving flexible and complex hard coding problems

2021-11-08

C test calls the paddlesharp module to recognize pictures and words

Good test data management, in the end how to do?

If I am PM's performance, movie VR ticket purchase display
随机推荐
【openh264】cmake: msopenh264-static
[the background color changes after clicking a line]
Traversal array, object parent-child communication props / $emit
[no title] Click the classification jump page to display the details
可執行程序執行流程
Three of three JS (WEB GL) model deletion / scene emptying / simple sorting of memory release
Three 之 three.js (webgl)旋转属性函数的简单整理,以及基于此实现绕轴旋转的简单案例
狼叔来找翻译人员了--plato--持续翻译中.....
2021-09-28
即将毕业的大学生找技术开发工作的焦虑根源
Basic use of sqlyog
Cross domain CORS relationship~
Graphics. Fromimage reports an error "graphics object cannot be created from an image that has an indexed pixel..."
TSlint注释忽略错误和RESTful理解
巴普洛夫与兴趣爱好
Understand the relationship between promise async await
Three methods of list rendering
Multi process model in egg -- egg document Porter
Branch and loop statements
[untitled]