Experiment 10--definition and reference of one-dimensional arrays

Source: Internet
Author: User
Tags array length

1 knowledge points learned in this lesson:

(1) Once you have defined the array, you can use it. The C language specifies that only a single array element can be referenced, but not the entire array at a time.

(2) When defining an array, the square brackets are constant expressions, which represent the length of the array, which can include constants and symbolic constants, but not variables.

2. Problems encountered during the experiment and solutions:

There are basic examples in the book, and will not find the answer in the book. Finish the homework according to the example in the book.

3. Experience of experiment and summary of the study in this chapter:

(1) The subscript of an array starts from 0 and the subscript cannot be crossed.

(2) Array elements are used in exactly the same way as variables of the same type.

(3) As with the initialization of simple variables, when you define an array, you can also assign an initial value to a group element. Its general form: Type an array group name [array length]={initial value table};

The 42-d array is defined as: Type an array group name [length of line] [column];

The elements referencing a two-dimensional array are assigned two subscript, subscript and column subscript, in the form: array name [subscript] [column subscript]

Branch assignment initial value, general form: Type an array group name [President degree] [column length]={{initial value table 0},...,{initial value k}, ...};

Experiment 10--definition and reference of one-dimensional arrays

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.