JavaShuo
栏目
标签
int *ptr=(int *)(&a+1)
时间 2020-12-26
原文
原文链接
昨晚有小伙伴问了一道题,感觉挺经典的。 1 int a[5] = {1, 2, 3, 4, 5}; 2 3 int *ptr = (int *) (&a + 1); 4 5 printf("%d %d \n\r", *(a + 1), *(ptr - 1) ); 从内存分布的角度来解析: &a和a做右值时的区别: &a是整个数组的首地址,而a是数组首元素的首地址。这两个在数字上是相等的
>>阅读原文<<
相关文章
1.
指针和引用(int*、int&、int*&、int&*、int**)
2.
指针和引用---int*、int&、int*&、int&*、int**
3.
int const*与int * const
4.
int indexs=(int)(_v+0.5);
5.
void (*f(int, void (*)(int)))(int) 函数解析
6.
简化void(*signal(int signum, void(*handler)(int)))(int)
7.
String的indexOf(),lastIndexOf(),substring(int x),substring(int x , int y)方法 StringBuffer
8.
【C / C++】const int *,int * const,int const *,int const * const 的区分技巧
9.
int
10.
int,long,还有mysql的int
更多相关文章...
•
MySQL INT、TINYINT、SMALLINT、MEDIUMINT、BIGINT(整数类型)
-
MySQL教程
•
C# 不安全代码
-
C#教程
•
Java 8 Stream 教程
•
委托模式
相关标签/搜索
int
c++int
ptr
a1
tensor&ndarray&int
str&int&bool
0
分享到微博
分享到微信
分享到QQ
每日一句
每一个你不满意的现在,都有一个你没有努力的曾经。
最新文章
1.
「插件」Runner更新Pro版,帮助设计师远离996
2.
错误 707 Could not load file or assembly ‘Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKe
3.
Jenkins 2018 报告速览,Kubernetes使用率跃升235%!
4.
TVI-Android技术篇之注解Annotation
5.
android studio启动项目
6.
Android的ADIL
7.
Android卡顿的检测及优化方法汇总(线下+线上)
8.
登录注册的业务逻辑流程梳理
9.
NDK(1)创建自己的C/C++文件
10.
小菜的系统框架界面设计-你的评估是我的决策
本站公众号
欢迎关注本站公众号,获取更多信息
相关文章
1.
指针和引用(int*、int&、int*&、int&*、int**)
2.
指针和引用---int*、int&、int*&、int&*、int**
3.
int const*与int * const
4.
int indexs=(int)(_v+0.5);
5.
void (*f(int, void (*)(int)))(int) 函数解析
6.
简化void(*signal(int signum, void(*handler)(int)))(int)
7.
String的indexOf(),lastIndexOf(),substring(int x),substring(int x , int y)方法 StringBuffer
8.
【C / C++】const int *,int * const,int const *,int const * const 的区分技巧
9.
int
10.
int,long,还有mysql的int
>>更多相关文章<<