当前位置:网站首页>指针数组与数组指针的区分
指针数组与数组指针的区分
2022-04-23 19:24:00 【ToneChip】
下面到底哪个是数组指针,哪个是指针数组呢:
A)
int *p1[10];
B)
int (*p2)[10];
每次上课问这个问题,总有弄不清楚的。这里需要明白一个符号之间的优先级问题。
A)“[]”的优先级比“*”要高。p1 先与“[]”结合,构成一个数组的定义,数组名为p1,int *修饰的是数组的内容,即数组的每个元素。那现在我们清楚,这是一个数组,其包含10 个指向int 类型数据的指针,即指针数组
B),在这里“()”的优先级比“[]”高,“*”号和p2 构成一个指针的定义,指针变量名为p2,int 修饰的是数组的内容,即数组的每个元素。数组在这里并没有名字,是个匿名数组。那现在我们清楚p2 是一个指针,它指向一个包含10 个int 类型数据的数组,即数组指针
版权声明
本文为[ToneChip]所创,转载请带上原文链接,感谢
https://tonechip.blog.csdn.net/article/details/122898659
边栏推荐
- Matlab 2019 installation of deep learning toolbox model for googlenet network
- 该买什么设备,Keysight 给你挑好了
- How to select the third-party package of golang
- Core concepts of rest
- Openlayers draw rectangle
- Go modules daily use
- NiO related Basics
- Coordinate conversion WGS-84 to gcj-02 and gcj-02 to WGS-84
- Machine learning catalog
- 点云数据集常用处理
猜你喜欢
[报告] Microsoft :Application of deep learning methods in speech enhancement
binlog2sql 工具安装使用及问题汇总
[report] Microsoft: application of deep learning methods in speech enhancement
Reflection on the performance of some OpenGL operations in the past
Virtual machine performance monitoring and fault handling tools
An algorithm problem was encountered during the interview_ Find the mirrored word pairs in the dictionary
Openharmony open source developer growth plan, looking for new open source forces that change the world!
White screen processing method of fulter startup page
Kubernetes入门到精通-KtConnect(全称Kubernetes Toolkit Connect)是一款基于Kubernetes环境用于提高本地测试联调效率的小工具。
No, some people can't do the National Day avatar applet (you can open the traffic master and earn pocket money)
随机推荐
Transaction processing of SQL Server database
openlayers 5.0 热力图
Wechat video extraction and receiving file path
Why is PostgreSQL about to surpass SQL Server?
OpenHarmony开源开发者成长计划,寻找改变世界的开源新生力!
Common SQL commands
UML类图几种关系的总结
One stop service platform for high-level talents and development of comprehensive service platform system for talents
[report] Microsoft: application of deep learning methods in speech enhancement
openlayers 5.0 离散聚合点
[记录]TypeError: this.getOptions is not a function
The most detailed network counting experiment in history (2) -- rip experiment of layer 3 switch
Installation, use and problem summary of binlog2sql tool
arcMap 发布切片服务
[play with lighthouse] Tencent cloud lightweight server builds a full platform video analysis video download website
Openharmony open source developer growth plan, looking for new open source forces that change the world!
SSDB foundation 2
static类变量快速入门
Codeforces Round #784 (Div. 4)
Coordinate conversion WGS-84 to gcj-02 and gcj-02 to WGS-84