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

Source: Internet
Author: User
Tags array definition array length

1. The knowledge points learned in this lesson:

(1) Defines an array that requires explicit array variable names, the type of array elements, and the size of the arrays.

The general form of a one-dimensional array definition is: Type an array group name [array length];

(2) array subscript starting from 0, subscript cannot be crossed.

(3) Initialization of one-dimensional arrays: As with the initialization of simple variables, when you define an array, you can also assign an initial value to a group element.

The general form is: Type an array group name [array length]=[initial value table];

2. Problems encountered during the experiment and solutions:

Problem: Defining arrays and arrays is always the wrong number.

Method: Do more reading, do not ask the teacher.

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

This chapter learns one of the most basic types of construction-arrays, which are an orderly combination of data of the same type. The elements in the array are kept in memory, each element is of the same data type, and array elements can be uniquely determined with array names and subscripts.

4. Preview (two-dimensional array)

(1) The definition form of two-dimensional array: Type an array group name [line length] [column length];

(2) A reference to a two-dimensional array should refer to two subscripts in the form:

Array name [row subscript] [column subscript]

Row subscript Reasonable range [0, line length-1], column subscript reasonable range [0, column length-1].

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.