C Language Pointers

Source: Internet
Author: User
1, pointer pointer, two-level pointer int a = 1;*AA = &A;**AAA = &aaaaa value: **AAAAAA Address: *aaa 2, void (*b[10]) (void (*) ()), B is an array, the array has 10 element, each element is a pointer to a function, the function argument is "void (*) ()" "Note 1", and the return value is "void"! Note 1: This parameter is also a pointer to a function, the function parameter is empty, the return value is "void". int* (*a[5]) (int, char*), first see the identifier name a, "[]" priority is greater than "*", A and "[5]" first combined. So a is an array, the array has 5 elements, each element is a pointer, pointer to "(int, char*)", pair, point to a function, the function argument is "int, char*", the return value is "int*". Cast to a function pointer, this function returns a value of void, the argument is void *, like void (*fun) (void *) void in Chinese translated to "untyped". It is commonly used in programming to declare the parameter types, return values, and pointer types in functions that define functions. void literal means "no type", void * is "untyped pointer", void * can point to any type of data. (Void (*) (void *)) cast to a function pointer, the function return value is void, the argument is void *, like void (*fun) (void *)

C Language Pointers

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.