function pointers and pointer functions and callback functions, and array of function pointers

Source: Internet
Author: User

1. First, a function pointer is a pointer to a function

2. The pointer function is the function of the pointer. That is, the return value is a pointer.

First, the pointer

"1" Pointer 1---pointer variable: variable 2 for storing address amount---address constant int a =; int *p = &a;

The "2" Operator 1---& 2---* (pointer dereference): Gets its contents by address 3---[]: only for pointer operations. Pointer plus unit length, followed by * operation.

Second, function

"1" pointer function "2" function pointer "3" function pointer array essence: array, consisting of elements of multiple elements: function pointer type int fun (char A, float b);  Int (*p[4]) (char,float); P[0] = fun;

The "4" function recursively calls 1---itself calls itself 2---must have an end condition

"5" Callback

int * Fun (int (*b) (char C, float D), char * e, double f);

Fun (function name, a, 32.45) {

}

function pointers and pointer functions and callback functions, and array of function pointers

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.