当前位置:网站首页>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)
边栏推荐
- MySQL community download address
- Stack and queue - 225. Implement stack with queue
- The fourth edition of Zhejiang University probability proves that the uncorrelation of normal distribution random variables is equivalent to independence
- IEEE Transaction期刊模板使用注意事项
- JS judge whether it is an integer
- "XXX" cannot be opened because the identity of the developer cannot be confirmed. Or what file has been damaged solution
- 栈与队列——225. 用队列实现栈
- 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
- Concurrent programming ----------- set
猜你喜欢

Maotai ice cream "bucked the trend" and became popular, but its cross-border meaning was not "selling ice cream"

正则表达和绕过案例

Remove the treasure box app with the green logo that cannot be deleted from iPhone

电赛设计报告模板及历年资源
![[oauth2] III. interpretation of oauth2 configuration](/img/31/90c79dbc91ee15c353ec46544c8efa.png)
[oauth2] III. interpretation of oauth2 configuration

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

Unity pedestrians walk randomly without collision

About the flicker problem caused by using universalimageloader to load pictures and refresh data in recyclerview

Matlab program for natural gas flow calculation

TypeError: Cannot read property ‘make‘ of undefined
随机推荐
[C language note sharing] - dynamic memory management malloc, free, calloc, realloc, flexible array
电赛设计报告模板及
"XXX" cannot be opened because the identity of the developer cannot be confirmed. Or what file has been damaged solution
Flink advanced features and new features (VIII) V2
Complete set of JS array common operations
After five years of contact with nearly 100 bosses, as a headhunter, I found that the secret of promotion was only four words
字符串——剑指 Offer 58 - II. 左旋转字符串
TypeError: 'str' object does not support item assignment
CSDN垃圾的没有底线!
5年接触近百位老板,身为猎头的我,发现升职的秘密不过4个字
Stack and queue - 225. Implement stack with queue
Mmdrawercontroller gets the current VC for push and pop
电赛设计报告模板及历年资源
【C语言笔记分享】——动态内存管理malloc、free、calloc、realloc、柔性数组
Uni app background audio will not be played after the screen is turned off or returned to the desktop
【NLP】下一站,Embodied AI
Stack and queue -- 232. Implement queue with stack
Rasa 3.x 学习系列-Rasa [3.2.4] - 2022-07-21 新版本发布
MySQL community download address
RHCE first operation