Differences and connections between a & amp; a [0], Doraemon

Source: Internet
Author: User

Differences and connections between a & a [0], Doraemon

In the array, a is the first address of the array, and & a [0] is the address of the first element of the array.

So a = & a [0]

But what is &?

 

 

 

Let's test the following code:

#include <stdio.h>void main(void){        int a[5] = {0};    printf("a---------->%p\n", a);    printf("&a--------->%p\n", &a);    printf("&a[0]------>%p\n", &a[0]);    printf("\nafter changed\n\n");
printf("a+1-------->%p\n", a + 1); printf("&a+1------->%p\n", &a + 1); printf("&a[0]+1---->%p\n", &a[0]+1);}

The output is as follows:

A ----------> 004DF870 & a ---------> 004DF870 & a [0] ------> 004DF870after changeda + 1 --------> 004DF874 // The value is increased by 4 to an int length, the address is the second element address of the array & a + 1 -------> 004DF884 // The value is increased by 20, which is the length of five int types, this address is the next element address after the array ends & a [0] + 1 ----> 004DF874 // The value is increased by 4, which is the same as that of a + 1

 

Although a = & a [0] In the result, the three values have different meanings.

 

Conclusion:

  • A Indicates the first address of the array element. It can also be used as an array pointer.
  • & A indicates the first address of the entire array
  • & A [0] indicates the address of the first element of the array

 


A and an are used differently.

Use an before the vowel, and use a before the rest.
Vowel: a, e, I, o, u

Many people may fall into misunderstanding about this type of problem. I think we should use an uncertain title before we see a, e, I, o, and u. If not, we should use a. This is wrong, in fact, I thought this way when I was in high school!
The correct understanding should be when a single letter or word starts with a vowel (PS: This word is very delicate, pay attention to understanding, and exercise more, it may be difficult to distinguish between "starting with a vowel,
It doesn't matter. Anyone like me can win an IQ. you young people are fine !) Use an, otherwise use a. It can be said that when using an, it has nothing to do with whether there is a vowel.

A is used before the consonants; an is used before the vowels. Generally, a vowel is a vowel, and a consonant is a consonant.
Note the following three points:
(1) A word whose spelling starts with a consonant letter and whose pronunciation starts with a vowel
Although the spelling of hour, honest, honor and other words starts with the consonants h, their pronunciation starts with a vowel. Therefore, an is used before.
(2) words that start with a vowel but start with a consonant
Useful, university, usual, united, European, one-eyed, one-way, and other words start with a vowel, but their pronunciation starts with a vowel, use a before.
(3) In 26 English letters, a, e, I, o, f, h, l, m, n, r, s, the pronunciation of the 12 letters x starts with a vowel, and the pronunciation of the other letters starts with a consonant.

The questions related to The (3) situations are rare. They are nothing more than The questions such as The word "empty" between des ___ "m" and ___ "y. I don't know whether there are other shortcuts for improving the type of question (3). I have to go to high school to solve this kind of problem every day, it is not until the pronunciation starts with a vowel. Isn't it 12? Fix it!

A and an are used differently.

Use an before the vowel, and use a before the rest.
Vowel: a, e, I, o, u

Many people may fall into misunderstanding about this type of problem. I think we should use an uncertain title before we see a, e, I, o, and u. If not, we should use a. This is wrong, in fact, I thought this way when I was in high school!
The correct understanding should be when a single letter or word starts with a vowel (PS: This word is very delicate, pay attention to understanding, and exercise more, it may be difficult to distinguish between "starting with a vowel,
It doesn't matter. Anyone like me can win an IQ. you young people are fine !) Use an, otherwise use a. It can be said that when using an, it has nothing to do with whether there is a vowel.

A is used before the consonants; an is used before the vowels. Generally, a vowel is a vowel, and a consonant is a consonant.
Note the following three points:
(1) A word whose spelling starts with a consonant letter and whose pronunciation starts with a vowel
Although the spelling of hour, honest, honor and other words starts with the consonants h, their pronunciation starts with a vowel. Therefore, an is used before.
(2) words that start with a vowel but start with a consonant
Useful, university, usual, united, European, one-eyed, one-way, and other words start with a vowel, but their pronunciation starts with a vowel, use a before.
(3) In 26 English letters, a, e, I, o, f, h, l, m, n, r, s, the pronunciation of the 12 letters x starts with a vowel, and the pronunciation of the other letters starts with a consonant.

The questions related to The (3) situations are rare. They are nothing more than The questions such as The word "empty" between des ___ "m" and ___ "y. I don't know whether there are other shortcuts for improving the type of question (3). I have to go to high school to solve this kind of problem every day, it is not until the pronunciation starts with a vowel. Isn't it 12? Fix it!

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.