Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and beauty - What is int fun (int * c) main () {int (* a) () = fun, * b (), w [10]...} int (* a) () = fun?
What is int fun (int * c) main () {int (* a) () = fun, * b (), w [10]...} int (* a) () = fun?
Interest fund (interest *c)

{

....

}

The above part declares a function, which inputs the shaping pointer and outputs the shaping;

And then in main,

int(*a)()=fun,

First, declare a pointer A to the function, which points to the type of int (*).

Then assign the address of the function fun to the function pointer A, and let A point to this function.

Then you can call this function with a in the program, that is,

a( 1); And fun (1); Is an equivalent call.

The advantage is that the function pointer A can point to other functions as needed, thus realizing the function of calling different functions.