当前位置:网站首页>Add two pointers? (legal or illegal)
Add two pointers? (legal or illegal)
2022-04-23 05:27:00 【What’smean】
illegal !
A pointer is also an object , The properties related to pointers are 3 individual , Are the values of the pointer itself (value)、 The object that the pointer refers to (content) And the storage location of the pointer itself in memory (address). They mean, respectively :
The value of the pointer itself is a memory address value , Indicates the storage address of the object referred to by the pointer in memory ;
The object referred to by the pointer can be accessed through the dereference pointer ;
Because the pointer is also an object , So the pointer is also stored somewhere in memory , It has its own address , That's why “ The pointer of the pointer ” Why .
From the above analysis, we know that , The value of the pointer is the memory address of the object it refers to , If we add two pointers together , Is trying to add the storage addresses of two objects in memory , This is obviously meaningless . By contrast , The subtraction of pointers is meaningful . If two pointers point to different elements in the same array , The result of their subtraction represents the distance of the elements they refer to in the array .
版权声明
本文为[What’smean]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204220544124251.html
边栏推荐
- 修仙真实世界与游戏世界
- Vscode settings JSON configuration
- d. TS --- for more detailed knowledge, please refer to the introduction on the official website (chapter of declaration document)
- Use of ES6 array
- The title bar will be pushed to coincide with the status bar
- Semi synchronous replication of MariaDB
- To understand Devops, you must read these ten books!
- Graphics.FromImage报错“Graphics object cannot be created from an image that has an indexed pixel ...”
- Various situations of data / component binding
- Data management of basic operation of mairadb database
猜你喜欢
双击.jar包无法运行解决方法
If I am PM's performance, movie VR ticket purchase display
what is wifi6?
Basic use of sqlyog
[triangle Yang Hui triangle printing odd even cycle JS for break cycle]
CPT 104_TTL 09
Intel SGX preliminary learning and understanding notes (continuously updated)
2021-10-12
What are the reasons for the failure of digital transformation?
Uncle wolf is looking for a translator -- Plato -- ongoing translation
随机推荐
五一劳动节期间什么理财产品会有收益?
How to add beautiful code blocks in word | a very complete method to sort out and compare
Three of three JS (webgl) simple sorting of rotation attribute function, and a simple case of rotating around the axis based on this
node中的redis使用--ioredis
如果我是pm之 演出电影vr购票展示
Basic knowledge of redis
WTL self drawn control library (cqscheckcomboxbox)
JSON.
2021-11-08
Simple and basic use of switch and if
Wbpack configuring production development environment
egg中的多进程模型--egg文档搬运工
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)
Laravel routing settings
Getting started with varnish
Blender programmed terrain production
varnish入门
Tslint annotations ignore errors and restful understanding
When is it appropriate for automated testing? (bottom)
Laravel [view]