Strange declarations in C language

Source: Internet
Author: User

int b[8][8]; An array of type int
int **ptr; Pointer to a pointer to int
int *risks[10]; An array with 10 elements, each of which is a pointer to an int
Int (* risk) [10]; A pointer to an int array with 10 elements
int * Abc[3][4]; An array of 3*4, each element is a pointer to an int
INT (* ABC) [3][4]; A pointer to an int array that points to 3*4
Int (* abc[3]) [4]; An array with 3 elements, each of which is a pointer to an int array with 4 elements


() [] has the same priority, which is combined from left to right
typdef int arr5[5];
Typdef ARR5 * P_ARR5;
typedef P_ARR5 ARRP10[10];
ARR5 togs; Togs is an int array with 5 elements;
P_ARR5 P2; P2 is a pointer to an int array with 5 elements
ARRP10 ap; An AP is an array of pointers with 10 elements. Each pointer points to an int array with 5 elements 3


TYPDEF Create a name for your own data structure

Strange declarations in C language

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.