Some confusing concepts in C language

Source: Internet
Author: User

① array pointers and arrays of pointers

1. The array pointer is used to point to an array whose name is the address of the first element of the array (the array name is a pointer to the first element of the element type and points to the beginning, such as int array[5], and the array is a pointer to array[0] and the type is int*)

int testarray[5] = {12345}; int (*ptestarray) [5] = &Testarray; int *ptest = Testarray;

2. The pointer array is a normal array in which each element of the array is a pointer

int* testarray[5];

② easy to confuse definition

1. Defining an array pointer

int (*PTR) [5];  int (*) [5] ptr;

2. Define a function pointer

int (*PTR) (intint (*) (int i) ptr;

3. Define an array of function pointers

int (*parray[5]) (int i)

4. Define a pointer to a function pointer array

int (* (*PF) [3]) (int i);

Some confusing concepts in C language

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.