Often, when we mention pointer functions and function pointers, many people don't understand them. The following is a detailed introduction to the pointer functions and function pointers in the C language.
Article Directory
-
-
- Pointer function
- Function pointer
- Function pointer enhancement
- Function pointer array and pointer to function pointer
- Pointer type parameters and return values
- Function pointer
- Function pointer basic syntax
- Function pointer array
- Function pointer as function parameter
- Function pointer embedded in structure to achieve layer
-
Pointer function
When a function declares that its return value is a pointer, it actually returns an address to the calling function for use in expressions that require a pointer or address.
format:
类型说明符 * 函数名(参数)
Since what is returned is an address, the type specifier is generally int.
In the C language, a function is also a type, and a pointer to the function can be defined. We know that the memory unit of the pointer variable stores an address value, and the function pointer stores the entry address of the function