Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Quisque sed felis. Aliquam sit amet felis.

Quisque sed felis. Aliquam sit amet felis. Mauris semper, velit semper laoreet dictum, quam diam dictum urna, nec placerat elit nisl in quam.

Get the latest news!


ARRAY DESCRIPTION
The position of each component in the array is expressed as index numbers.
In other sources, the array is a structured data type contained in the memory consists of a number of elements (right) which has the same data type and is a combination of several similar variables and has a fixed number of components. The elements of the array is composed seacara sequential in computer memory.

1.      One-dimensional Array 
Array dimension is nothing but a collection of identical elements, which are arranged in one line. Tersebuit elements have the same data type, but the contents of these elements may vary. Declare the array of raw type the word premises preceded and followed by the name of the array and mark samaq with (=), and said its range of raw array index and ending with the word standard of its type data.

The general form of array type declaration is:
type identifier = array [tipe_index] of type;
with identifier: name data type
tipe_index: type of data to index numbers
type: data type components
Tipe_index parameter determines the number of components of the array. This parameter can be any type except logint ordinal and sub-range of logint. Here are examples of declarations:
Vek type = array [1 ... .. 100] of integer;
shows that Vek is the type of data in the form of an array of integers and the number of components 100 pieces.
Such declarations are called one-dimensional array declaration, which we call vector.

2.      Two-dimensional array
Two-dimensional array, which is often depicted in a matrix is ​​an extension of a one-dimensional array. If the one-dimensional array consists only of a row with multiple columns, the elements on two-dimensional array consisting of several rows and several columns bertype same elements. If the component type of array is also another, will we get a lot dimensional array. For example:
pkl type = array [1 ... .. 100] of array [1 ... ... .5] of real;
indicates that the PKI is a vector consisting of 100 components, with its component type is a vector that has 5 components of type real. This form is often called a two-dimensional array declaration which we call a table or matrix.

3.      Three-dimensional array
Three-dimensional array can be described as an object space. Declaration on the three-dimensional array array do not differ on one dimension and two dimensions which have been described previously, except in the index array.

pkl type = array [1 .. 100.1 ... ... ... 5] of real;
Another example:
Katro type = array [boolean, 1 ... .. 100.1 ... ... 5] of char; 

The above declaration is called the declaration of three-dimensional array.
4.      Many-dimensional Array
Actually, many-dimensional array is not too often used as well as one-dimensional array, two dimensional, and three dimensions. But it does not mean that Pascal does not allow you to wear. Many-dimensional array is essentially the same as before except on the number of array dimensions only.

Views

Leave a reply

0 Comments to "ARRAY"

  • Share
  • [i]