当前位置:网站首页>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)
边栏推荐
- 微信小程序 TODO案例
- IntelliSense of Visual Studio: 'no members available'
- Detailed explanation of IO model (easy to understand)
- C unsafe unmanaged object pointer conversion
- 字符串——28. 实现 strStr()
- Data modification modification
- After reading this article, I found that my test cases were written in garbage
- Nmap security testing tool tutorial
- CAS atomic type
- The latest and complete Flink series tutorials in 2021_ Preliminary exploration of Flink principle and flow batch integration API (II. V) V2
猜你喜欢
![[C language note sharing] - dynamic memory management malloc, free, calloc, realloc, flexible array](/img/3f/35c9ff3be5c0ef781ffcb537287a20.png)
[C language note sharing] - dynamic memory management malloc, free, calloc, realloc, flexible array

Regular expression and bypass cases

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

About the flicker problem caused by using universalimageloader to load pictures and refresh data in recyclerview
![[NLP] next stop, embossed AI](/img/fc/4997309d0d53c5b6eb441ac39e6929.jpg)
[NLP] next stop, embossed AI

The sliding window of Li Kou "step by step" (209. The smallest sub array, 904. Fruit baskets)

北京一卡通以35288.8529万元挂牌出让68.45%股权,溢价率为84%
![Rasa 3.x 学习系列-Rasa [3.2.4] - 2022-07-21 新版本发布](/img/1e/27f107d514ded6641410cc5a45764b.png)
Rasa 3.x 学习系列-Rasa [3.2.4] - 2022-07-21 新版本发布

Centos7安装达梦单机数据库

Source code analysis of ArrayList
随机推荐
2022.7.22 simulation match
uni-app 背景音频 熄屏或者退回桌面之后不在播放
Rasa 3.x learning series -rasa fallbackclassifier source code learning notes
自动化渗透扫描工具
Lazy loading of pictures
TypeError: Cannot read property ‘make‘ of undefined
Wechat applet todo case
Don't lose heart. The famous research on the explosive influence of Yolo and PageRank has been rejected by the CS summit
C# unsafe 非托管对象指针转换
Rasa 3.x 学习系列-Rasa [3.2.3] - 2022-07-18 新版本发布
Was installer startup error
Data Lake series articles
Unity行人随机行走不碰撞
Multithreaded common classes
清除字符串中所有空格
SQL subquery
小熊派 课程导读
Video game design report template and
Flinktable & SQL (VII)
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