当前位置:网站首页>"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 》
边栏推荐
- Gan network thought
- Self introduction and objectives
- Webrtc native M96 version opening trip -- a reading code download and compilation (Ninja GN depot_tools)
- [set theory] relation properties (transitivity | transitivity examples | transitivity related theorems)
- Promise
- Disassembly and installation of Lenovo r7000 graphics card
- [batch dos-cmd command - summary and summary] - CMD window setting and operation command - close CMD window and exit CMD environment (exit, exit /b, goto: EOF)
- Explanation of several points needing attention in final (tested by the author)
- Go practice -- factory mode of design patterns in golang (simple factory, factory method, abstract factory)
- 聊聊如何利用p6spy进行sql监控
猜你喜欢

Webrtc protocol introduction -- an article to understand ice, stun, NAT, turn

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

Go practice -- gorilla / websocket used by gorilla web Toolkit
![[set theory] relation properties (transitivity | transitivity examples | transitivity related theorems)](/img/c2/87358af6b2b2892a6eceb751b3b60c.jpg)
[set theory] relation properties (transitivity | transitivity examples | transitivity related theorems)

Gan network thought
![[basic grammar] Snake game written in C language](/img/cb/83631ef3ccd7047ca42d33dc49bf90.jpg)
[basic grammar] Snake game written in C language

DEX net 2.0 for crawl detection

appium1.22. Appium inspector after X version needs to be installed separately

Celebrate the new year together

Primary school campus IP network broadcasting - Design of primary school IP digital broadcasting system based on campus LAN
随机推荐
微服务常见面试题
DEX net 2.0 for crawl detection
SimpleITK学习笔记
获取并监控远程服务器日志
Promise
Introduction to webrtc protocol -- an article to understand dtls, SRTP, srtcp
Common methods of JS array
Talk about how to use p6spy for SQL monitoring
Maximum continuous sub segment sum (dynamic programming, recursive, recursive)
Go practice - gorilla / handlers used by gorilla web Toolkit
Deploy crawl detection network using tensorrt (I)
College campus IP network broadcasting - manufacturer's design guide for college campus IP broadcasting scheme based on campus LAN
Differences among bio, NiO and AIO
leetcode860. Lemonade change
MySQL master-slave configuration
[basic grammar] Snake game written in C language
Force GCC to compile 32-bit programs on 64 bit platform
6.23 warehouse operation on Thursday
(perfect solution) how to set the position of Matplotlib legend freely
Why should we rewrite hashcode when we rewrite the equals method?