Home > Common Problem > What is an array

What is an array

青灯夜游
Release: 2020-09-15 17:50:36
Original
31493 people have browsed it

In programming, an array is a form of organizing several elements of the same type in an unordered form for the convenience of processing. It is used to store multiple sets of the same type of data. By using arrays, program code can be shortened and simplified to a great extent, thereby increasing the efficiency of the application.

What is an array

Related recommendations: "The most comprehensive summary of array methods"

Array (Array ) is an ordered sequence of elements. If a limited collection of variables of the same type is named, then the name is the array name. The individual variables that make up an array are called components of the array, also called elements of the array, and sometimes called subscript variables. The numeric number used to distinguish the individual elements of an array is called a subscript. In programming, an array is a form of organizing several elements of the same type in an orderly manner for the convenience of processing. These ordered collections of similar data elements are called arrays.

Array is a collection used to store multiple data of the same type.

In some cases, although a single variable can be used to store information, if a lot of information needs to be stored, it will be very troublesome to create variable declarations and assign values ​​in sequence. As the amount of information processed becomes larger and larger, the work becomes more and more cumbersome. At this time, arrays or sets can be used to store information. So what is an array?

Array is a form of organizing several elements of the same type in an unordered manner for the convenience of processing in programming. These unordered collections of similar data elements are called arrays.

Array is the simplest composite data type. It is an ordered sequence of elements and is used to store multiple sets of the same type of data. By using arrays, program code can be shortened and simplified to a great extent, thereby increasing the efficiency of the application.

If you name a limited collection of variables of the same type, then the name is the array name. The individual variables that make up an array are called components of the array, also called elements of the array, and sometimes called subscript variables. The numeric number used to distinguish the individual elements of an array is called a subscript.

Arrays have the following characteristics:

● Arrays can be one-dimensional arrays, two-dimensional arrays, or multi-dimensional arrays.

● The default value of numeric array elements is 0, while the default value of reference elements is null.

● A jagged array is an array of arrays, therefore, its elements are reference types and are initialized to null. The dimensions and sizes of the elements of a jagged array can vary.

● The index of the array starts from 0. If the array has n elements, then the index of the array is from 0 to (n-1).

●Array elements can be of any type, including array types.

● The array type is a reference type derived from the abstract base class Array.

[Recommended related articles]

How to define arrays in C language?

The above is the detailed content of What is an array. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template