typedef void (*func3)(int, int); is a function that existed from C language and declared a function pointer as a data type using typeef.
Because it has the properties of a pointer, you can declare the variable alone first and then put the address of the function later, or you can initialize it at the same time as the declaration.
typedef void (&func2) (int, int); is used in the C++ language (the reference operator is from C++) and the function reference is declared in a data format using typeef.
Because it has the nature of a reference, you cannot declare a variable alone (the nickname of the function you want to insert), and you must initialize it at the same time as the variable declaration.
typedef void func1(int, int); is a function that existed from C language and declared a function prototype as a data type using typeef.
This is usually used to hand over a function pointer as a parameter of a particular function and take it as a temporary function (such as a local variable) of that function.
© 2022 pinfo. All rights reserved.