pointer arrays and array pointers

Source: Internet
Author: User

Pointer Array (array ofpointers): An array of stored pointers

Array pointers (a pointerto an array): pointers to arrays, also known as "row pointers"

array of pointers ( Array of pointers )

  Example of defining a method: int *a[10] equivalent to int * (A[10])

First, A is an array with 10 elements, each of which is a pointer to an integer data.

[] The priority is higher than *, [] first with a, so that a becomes an array.

Array Pointers ( A pointer to an array )

  Example of defining a method: Int (*a) [10]

First, A is a pointer variable, and the pointer variable points to the first address of the array.

The () operator has a higher precedence than [], so *a is first operated, stating that A is a pointer variable.

An article that describes the difference in more detail: http://www.cnblogs.com/mq0036/p/3382732.html

pointer arrays and array 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.