当前位置:网站首页>C language: talking about various complex statements
C language: talking about various complex statements
2022-07-29 04:16:00 【White night gxw】
Beginners are often at a loss in the face of various complex statements , It can even be said to be confused , I don't know where to start , This article is about C Talk about all kinds of complex statements in language , Hope to help beginners , The next time you encounter a complex statement, don't be confused .
Let's first look at some symbols of complex declarations
| Symbol | meaning |
|---|---|
| * | It means a pointer |
| ( ) | Represents a function |
| [ ] | Represents an array |
Here are some examples of more complex declarations :
If you can understand the following examples , That means you are excellent ~
1.int board[8] [8]; // Declare a statement that contains int Array of arrays
2.int ** ptr; // Declare a pointer to a pointer , The pointed pointer points to int
3.int * risks[10]; // Declare an array containing ten elements , Every element is a point to int The pointer to
4.int (* rusks)[10]; // Declare a pointer to an array , The array contains ten int Type value
5.int * oof[3] [4]; // Make a statement 3*4 Two dimensional array of , Every element points to int Pointer to type
6.int (* uuf)[3] [4]; // Declare a point to 3*4 Pointer to a two-dimensional array , The array contains int Type value
7.int (*uof[3])[4]; // Make a statement 3 An array of pointer elements , Each of these pointers points to a containing 4 individual int Array of type elements
To understand the above statement , The key is to understand * 【】 () The priority of the . Remember ,()【】 The priority of is the same as and greater than that of , also ()【 The combination direction of is from left to right .
Next, let's analyze one by one :
1.int board 【8】【8】 ;
By priority ,board With the first 【8】 combination , This is an array , And again 【8】 combination , This is an array of arrays , It's a two-dimensional array .
2.int ** ptr;
By priority ,ptr First combine with the asterisk , Indicates that this is a pointer , Combined with the asterisk, it shows that this is a pointer to the pointer , That's the second level pointer .
3.int * risks[10];
By priority ,ricks With the first 【10】 combination , So this is an array , Then combine with the asterisk , Explain that the elements in the array are pointer variables . That is to say Pointer array
4.int (* rusks)[10];
By priority ,rusks First combine with the asterisk , Indicates that this is a pointer , And again 【10】 combination , This is a pointer to an array , That is to say Array pointer
5.int * oof[3] [4];
By priority ,oof With the first 【3】 combination , This is an array , And again 【4】 The combination shows that this is an array of arrays , It's a two-dimensional array , Then combine with the asterisk , Explain that each element in the two-dimensional array is a pointer variable .
6.int (* uuf)[3] [4];
By priority ,uuf First combine with the asterisk , Indicates that this is a pointer , And again 【3】 combination , This is a pointer to an array , And again 【4】 combination , Note that this is only a pointer to a two-dimensional array .
7.int (*uof[3])[4];
By priority ,uof The first and 【3】 combination , This is an array , And then combine with the asterisk , Explain that the elements in the array are pointer variables , And again 【4】 combination , Explain that each pointer points to an inclusion 4 individual int class .
边栏推荐
- The data source is SQL server. I want to configure the incremental data of the last two days of the date field updatedate to add
- 请问,在sql client中,执行insert into select from job时,如何单
- MPU6050
- 有没有大佬帮我看下flink sql连接kafka认证kerberos的参数配置是否有误
- AssertionError(“Torch not compiled with CUDA enabled“)
- 10. Fallback message
- [paper translation] vectornet: encoding HD maps and agent dynamics from vectorized representation
- View partition table format
- Labelme cannot open the picture
- How to query the submission number of a version
猜你喜欢

Fu Yingna: Yuan universe is the new generation of Internet!

The solution of porting stm32f103zet6 program to c8t6+c8t6 download program flash timeout

Two forms of softmax cross entropy + numpy implementation

Function pointer and callback function

Object detection: object_ Detection API +ssd target detection model

Value transmission and address transmission of C language, pointer of pointer

C语言力扣第61题之旋转链表。双端队列与构造循环链表

RMAN do not mark expired backups

SVG--loading动画

15.federation
随机推荐
Beginner: array & String
伏英娜:元宇宙就是新一代互联网!
Multi card training in pytorch
Blood cases caused by < meta charset=UTF-8> -- Analysis of common character codes
Taobao product details interface (product details page data interface)
[kvm] install KVM
14. Haproxy+kept load balancing and high availability
Not for 58 days. Implement prefix tree
Svg -- loading animation
顺序表和链表
Design of environment detection system based on STM32 and Alibaba cloud
SQL time fuzzy query datediff() function
Class starts! See how smardaten decomposes complex business scenarios
小程序:区域滚动、下拉刷新、上拉加载更多
一个公司的面试笔记
No, just stick to it for 64 days. Find the insertion location
9.延迟队列
不会就坚持58天吧 实现前缀树
rman不标记过期备份
不会就坚持66天吧 权重生成随机数