当前位置:网站首页>"C and pointer" - Chapter 13 advanced pointer int * (* (* (*f) () [6]) ()
"C and pointer" - Chapter 13 advanced pointer int * (* (* (*f) () [6]) ()
2022-07-03 05:22:00 【Dongli_】
Be careful : This is an original article , Without consent , Please do not reprint at will .
Catalog
1. The inference process from declaration of high-level pointer to description
Take the following pointers as an example :
int *(*(*(*f)())[6])();

1.1 Other small examples
| Serial number | Statement | describe |
|---|---|---|
| 1 | int f(); | f Is a function , Return integer |
| 2 | int f[3]; | f It contains 3 Array of elements , Element type is integer |
| 3 | int **f(); | f Is a function , The return type is a pointer to an integer pointer |
| 4 | int (*f)(); | f It's a pointer , Pointing function , Return integer , |
| 5 | int (*f)[6]; | f It's a pointer , Pointing to the array , Array has 3 Elements , The element type is integer ; |
| 6 | int *f(); | f Is a function , Returns an integer pointer |
| 7 | int **(*f[6])(); | f Is an array , Element type is pointer , Pointing function ; That is, the array element type is function pointer ; The return value is a pointer to an integer pointer |
| 8 | int **f[6]; | f Is an array , The element type is a pointer to an integer pointer |
| 9 | int *(*f)[6]; | f It's a pointer , Pointing to the array , namely f Is an array pointer ; Returns a pointer to an integer |
| 10 | int *(*f())(); | f Is a function , Return pointer , Pointer to function , That is, the return value type is function pointer ; The return value of the function is a pointer to an integer |
| 11 | int (**(*f)())(); | f It's a pointer , Pointing function , namely f It's a function pointer ; The function returns a pointer p1, The pointer p1 Point to another pointer p2, Another pointer p2 Pointing function , namely p2 It's a function pointer , This function pointer returns an integer ; namely f It's a function pointer ,f The function pointed to returns a pointer to the function pointer , The return value of the last returned function is an integer |
| 12 | int (*(*f)())[6]; | f It's a pointer , Pointing function , namely f It's a function pointer ; This function returns a pointer , The pointer points to int Type of the array ; namely f It's a function pointer , Returns a pointer to an integer array |
| 13 | int *(*(*(*f)())[6])(); | f It's a pointer , The pointer points to a function , Function returns an array pointer , Array elements are Pointers , Point to a function , That is, the array element is a function pointer , The return value of the function is an integer pointer . |
2. The writing idea of high-level pointer from description to declaration
Take the description of the following statement as an example :
The return value is 【 Point to " The return value is int Function pointer of type pointer " The pointer to the array of 】 Function pointer of

2.1 Other small examples
| Serial number | describe | Statement |
|---|---|---|
| 1 | int Type pointer | int *f; |
| 2 | int Type pointer | int** f; |
| 3 | int Type of the array | int f[6]; |
| 4 | Point to 【int Type of the array 】 The pointer to | int (*f)[6]; |
| 5 | int Type pointer array | int* f[6]; |
| 6 | Point to 【int Type pointer array 】 The pointer to | int* (*f)[6]; |
| 7 | int Pointer array of type pointer | int* *f[6]; |
| 8 | The return value is int Function of | int f(); |
| 9 | The return value is 【int Type pointer 】 Function of | int* f(); |
| 10 | The return value is 【int Type pointer 】 Function of | int** f(); |
| 11 | The return value is int Function pointer of | int (*f)(); |
| 12 | The return value is int Function pointer of type pointer | int* (*f)(); |
| 13 | The return value is int Function pointer of pointer of type | int** (*f)(); |
| 14 | The return value is int Array of function pointers | int (*f[6])(); |
| 15 | Point to 【 The return value is int Function of type pointer 】 An array of pointers for | int* (*f[6])(); |
| 16 | Point to 【 The return value is int Function of type pointer 】 An array of pointers for | int** (*f[6])(); |
| 17 | The return value is 【 The return value is int Function pointer of 】 Function of | int (*f())(); |
| 18 | The return value is 【 The return value is int Pointer to function of 】 Function of | int (**f())(); |
| 19 | The return value is 【 The return value is int Function pointer of type pointer 】 Function of | int* (*f())(); |
| 20 | The return value is 【 The return value is int Function pointer of 】 Function pointer of | int (*(*f)())(); |
| 21 | The return value is 【 The return value is int Pointer to the function of 】 Function pointer of | int (**(*f)())(); |
| 22 | The return value is 【 The return value is int Function pointer of type pointer 】 Function pointer of | int *(*(*f)())(); |
| 23 | The return value is 【 Point to int Pointer to type array 】 Function pointer of | int (*(*f)())[6]; |
| 24 | The return value is 【 Point to int Pointer of type pointer array 】 Function pointer of | int *(*(*f)())[6]; |
| 25 | The return value is 【 Point to " The return value is int Function pointer of type pointer " The pointer to the array of 】 Function pointer of | int* (*(*(*f)())[6])(); |
3. The literature
The subject comes from 《C And a pointer 》
边栏推荐
- cookie session jwt
- Web APIs exclusivity
- Technical analysis of qianyuantong multi card aggregation router
- "Hands on deep learning" pytorch edition Chapter II exercise
- How to set up altaro offsite server for replication
- Bluebridge cup real topic 2020 palindrome date simulation construction provincial competition
- (subplots用法)matplotlib如何绘制多个子图(轴域)
- Disassembly and installation of Lenovo r7000 graphics card
- XML Configuration File
- Introduction to webrtc protocol -- an article to understand dtls, SRTP, srtcp
猜你喜欢

Webrtc native M96 version opening trip -- a reading code download and compilation (Ninja GN depot_tools)

Go practice - gorilla / handlers used by gorilla web Toolkit

Use posture of sudo right raising vulnerability in actual combat (cve-2021-3156)

Webrtc M96 release notes (SDP abolishes Plan B and supports opus red redundant coding)

Pessimistic lock and optimistic lock of multithreading

Basic knowledge of reflection (detailed explanation)

Gbase8s unique index and non unique index

es7创建索引容易犯的错误

6.23星期四库作业

appium1.22.x 版本後的 appium inspector 需單獨安裝
随机推荐
獲取並監控遠程服務器日志
JS dynamic table creation
Gbase8s unique index and non unique index
Go practice -- closures in golang (anonymous functions, closures)
Redis 入门和数据类型讲解
Pessimistic lock and optimistic lock of multithreading
Webrtc M96 release notes (SDP abolishes Plan B and supports opus red redundant coding)
谷歌 | 蛋白序列的深度嵌入和比对
穀歌 | 蛋白序列的深度嵌入和比對
Webapidom get page elements
Celebrate the new year together
Chapter II program design of circular structure
XML Configuration File
JQ style, element operation, effect, filtering method and transformation, event object
3dslam with 16 line lidar and octomap
JS function algorithm interview case
在PyCharm中配置使用Anaconda环境
Introduction to deep learning - definition Introduction (I)
Altaro virtual machine replication failed: "unsupported file type vmgs"
小学校园IP网络广播-基于校园局域网的小学IP数字广播系统设计