当前位置:网站首页>"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 》
边栏推荐
- Based on RFC 3986 (unified resource descriptor (URI): general syntax)
- JS function algorithm interview case
- Differences among bio, NiO and AIO
- 穀歌 | 蛋白序列的深度嵌入和比對
- Go practice -- generate and read QR codes in golang (skip2 / go QRcode and boombuilder / barcode)
- Audio Focus Series: write a demo to understand audio focus and audiomananger
- Maximum continuous sub segment sum (dynamic programming, recursive, recursive)
- Webrtc native M96 version opening trip -- a reading code download and compilation (Ninja GN depot_tools)
- Redis expiration elimination mechanism
- About debugging the assignment of pagenum and PageSize of the formal parameter pageweb < T > (i.e. page encapsulation generic) in the controller
猜你喜欢

Webrtc protocol introduction -- an article to understand ice, stun, NAT, turn
![[set theory] relationship properties (common relationship properties | relationship properties examples | relationship operation properties)](/img/af/8dfa783c87363a9d75c52e7680d508.jpg)
[set theory] relationship properties (common relationship properties | relationship properties examples | relationship operation properties)

音频焦点系列:手写一个demo理解音频焦点与AudioMananger

College campus IP network broadcasting - manufacturer's design guide for college campus IP broadcasting scheme based on campus LAN

Botu uses peek and poke for IO mapping

Altaro virtual machine replication failed: "unsupported file type vmgs"

(subplots用法)matplotlib如何绘制多个子图(轴域)

Skip table: principle introduction, advantages and disadvantages of skiplist

Introduction to deep learning (II) -- univariate linear regression

Hotel public broadcasting background music - Design of hotel IP network broadcasting system based on Internet +
随机推荐
appium1.22. Appium inspector after X version needs to be installed separately
ES7 easy mistakes in index creation
Intégration profonde et alignement des séquences de protéines Google
[set theory] relation properties (transitivity | transitivity examples | transitivity related theorems)
酒店公共广播背景音乐-基于互联网+的酒店IP网络广播系统设计
Botu uses peek and poke for IO mapping
Gan network thought
Self introduction and objectives
大学校园IP网络广播-厂家基于校园局域网的大学校园IP广播方案设计指南
ROS Compilation Principle
Maximum continuous sub segment sum (dynamic programming, recursive, recursive)
[basic grammar] C language uses for loop to print Pentagram
Export the altaro event log to a text file
Promise
How to install and configure altaro VM backup for VMware vSphere
Webrtc M96 release notes (SDP abolishes Plan B and supports opus red redundant coding)
32GB Jetson Orin SOM 不能刷机问题排查
Go practice -- design patterns in golang's singleton
Webapidom get page elements
Altaro requirements for starting from backup on Hyper-V