当前位置:网站首页>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
边栏推荐
- Create cells through JS (while loop)
- Uniapp wechat sharing
- Three 之 three.js (webgl)模型的删除/场景的清空/内存的释放 的简单整理
- 使用宝塔+xdebug+vscode远程调试代码
- node中的redis使用--ioredis
- Double click The jar package cannot run the solution
- [no title] Click the classification jump page to display the details
- C# ,类库
- JSON.
- selenium預先加載cookie的必要性
猜你喜欢

Cross domain CORS relationship~

Arithmetic and logical operations

Fast application fuzzy search

Basic use of sqlyog

分支与循环语句

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

Quick app bottom navigation bar

npm升级后问题,慌得一批

2021-09-28
![[no title] Click the classification jump page to display the details](/img/a6/fb302129c06e07b8d1eddeaabc9d2d.png)
[no title] Click the classification jump page to display the details
随机推荐
JS array common methods
Understand the relationship between promise async await
Phlli in a VM node
npm升级后问题,慌得一批
可執行程序執行流程
Semi synchronous replication of MariaDB
Laravel [view]
Graphics.FromImage报错“Graphics object cannot be created from an image that has an indexed pixel ...”
egg中的cors和proxy(づ ̄3 ̄)づ╭~踩坑填坑的过程~ToT~
WTL 自绘控件库 (CQsCheckComboxBox)
巴普洛夫与兴趣爱好
SQL Server检索SQL和用户信息的需求
If the route reports an error after deployment according to the framework project
What are the reasons for the failure of digital transformation?
Kanban Quick Start Guide
d.ts---更详细的知识还是需要看官网的介绍(声明文件章节)
[untitled]
Error handling mechanism of the strongest egg framework in history
Use of uniapp native plug-ins
selenium預先加載cookie的必要性