当前位置:网站首页>Differences between C language pointer and array A and &a, &a[0], etc
Differences between C language pointer and array A and &a, &a[0], etc
2022-07-24 14:18:00 【Crazy Alex】
Suppose you define an array int a[5]={1,2,3,4,5};
a It represents this array variable
Here's the thing to remember a Equivalent to &a[0] Are the first element of the array a[0] The address of
and &a It means a The first address of the entire array , Although the actual values of the two are the same, they represent different meanings
a+1 It means The address of the first element plus the length of an element , The length of an element is one int type , That is to say
a+size of(int)
&a+1 Represents the first address of the entire array , Add the length of an array , It is &a+5*size of(int)
Suppose you define a int * Variable of type
int *ptr1 = int *(&a+1)
prt[-1] It is equivalent to *(ptr - 1)
边栏推荐
- The fourth edition of probability and mathematical statistics of Zhejiang University proves that the absolute value of the correlation coefficient of random variables X and Y is less than 1, and some
- IEEE Transaction期刊模板使用注意事项
- OWASP zap security testing tool tutorial (Advanced)
- MySQL community download address
- Introduction to Xiaoxiong school
- binlog、iptables防止nmap扫描、xtrabackup全量+增量备份以及redlog和binlog两者的关系
- SQL Server syntax - create database
- The solution to the error of [installation detects that the primary IP address of the system is the address assigned by DHCP] when installing Oracle10g under win7
- 不要灰心,大名鼎鼎的YOLO、PageRank影响力爆棚的研究,曾被CS顶会拒稿
- 栈与队列——232. 用栈实现队列
猜你喜欢

Must use destructuring props assignmenteslint

Centos7 installs Damon stand-alone database

C language -- program environment and preprocessing

Simple understanding and implementation of unity delegate

2022 IAA industry category development insight series report - phase II

看完这篇文章,才发现我的测试用例写的就是垃圾

Solve the problem that the ARR containsobject method returns no every time

Moving the mouse into select options will trigger the mouseleave event processing scheme

5年接触近百位老板,身为猎头的我,发现升职的秘密不过4个字
![Rasa 3.x learning series -rasa [3.2.4] - 2022-07-21 new release](/img/1e/27f107d514ded6641410cc5a45764b.png)
Rasa 3.x learning series -rasa [3.2.4] - 2022-07-21 new release
随机推荐
Rasa 3.x learning series -rasa [3.2.4] - 2022-07-21 new release
IntelliSense of Visual Studio: 'no members available'
正则表达和绕过案例
Nodejs uses the express framework to post the request message "badrequesterror:request aborted"
JS judge whether it is an integer
Beijing all in one card listed and sold 68.45% of its equity at 352.888529 million yuan, with a premium rate of 84%
[untitled] rhcsa first operation
About the flicker problem caused by using universalimageloader to load pictures and refresh data in recyclerview
Don't lose heart. The famous research on the explosive influence of Yolo and PageRank has been rejected by the CS summit
Flink advanced features and new features (VIII) V2
Mmdrawercontroller gets the current VC for push and pop
AtCoder Beginner Contest 261 F // 树状数组
Mini examination - examination system
Rasa 3.x 学习系列-Rasa [3.2.4] - 2022-07-21 新版本发布
Data modification and insertion
TypeError: 'str' object does not support item assignment
Rasa 3.x 学习系列-Rasa [3.2.3] - 2022-07-18 新版本发布
Add an element to the object array with unshift
MySQL community download address
threw exception [Circular view path [index]: would dispatch back to the current handler URL [/index]