Small knowledge point in C Language int * A [5] int (* B) [5]

Source: Internet
Author: User

Int main ()

{

Int * A [5];

INT (* B) [5];

Int I = 2, j = 3, K = 4;

B =;

A [0] = & I;

Printf ("% d/N", * a, * a [0], I );

Printf ("% d/N", a, a [0], & I );

Printf ("% d", B );

B ++;

Printf ("% d/N", B );

Getchar ();

}

 

[] The priority is higher than *, so a and B are two variables:

A Represents an array. Its array element storage type is int *;

The value of a represents the address value of the first element a [0] of the array. It is a pointer, that is, * A = A [0]. Note that the pointer type is const, that is, it cannot be changed.

 

B Represents an array pointer that points to an array of the int [5] type;

Because of the type of B, after B ++, it will offset sizeof (INT) * 5 bytes.

 

Some small C knowledge points.

 

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.