Function pointer is one of the best advantages of C . Advanced programmers as needed to use references as long as they are more likely to use references, because reference is easier to handle. However, when processing a function, the function reference comparison function pointer does not necessarily have this advantage. Existing code rarely uses a function reference. In this article, we will introduce you how to function pointers, how to use function references and use them in what circumstances. Below is some examples of function pointers: #include void print (inti) {std :: cout << i << std :: end1;} void print_2 (inti) {std :: cout << i << std :: endl } void multiply (int & ndest, intnby) {ndest * = nby;} void print_something () {std :: cout << "Something" << std :: endl;} int Return_1 () {Return 1;} int Main () {void (* func_1) (int); func_1 = & print; func_1 (1); //, we call it this this this this is / (because it is a pointer, so it can be retrieved) (* func_1 ) (1); func_1 = & print_2; func_1 (1); void (* func_2) (int) = & print_2; func_2 (1); Void (* func_3) (int &, int) = & multiply; inti = 1; std :: Cout << "[before] i =" << i << std :: endl; (* func_3) (i, 10); std :: cout << "[after] i =" << i << std: : ENDL; VOID (* FUNC_4) (); func_4 = & print_something; func_4 (); int (* func_5) (); // Note: Some compiler can let you write // "func_5 = return_1;" (ie ignored '&'); // However, we do not recommend this way of writing; // The following usage reveals that this fact: // 'FUNC_5' is a pointer, if you ignore the meaning of '&' // code Not clear enough FUNC_5 = & RETURN_1; std :: cout << (* func_5) () << std :: end1; std :: cin.get (); return 0;} // print, print_2, multiply, print_something, return_1 / / Wait for functions and the same.