An inductive summary of pointer arrays, array pointers, pointer functions, function pointers

Source: Internet
Author: User

an array of pointers , such as int *p[4]: Indicates that a one-dimensional array holds three pointer variables, respectively, p[0], p[1], p[2], p[3], and by default the three pointer variables are all pointing to null, so assign values separately.

Array pointers: such as int (*P) [4]: Indicates that an array pointer is defined, pointing to a one-dimensional array with 4 elements.

pointer functions: such as int *p (): Declares a function p, which returns a pointer of type int.

function pointers: such as int (*p) (): The function pointer is essentially a pointer to the entry address of the function

The best way to discriminate is to look at "*", Brackets put "*" is the XX pointer


An inductive summary of pointer arrays, array pointers, pointer functions, function 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.