Array is a collection of data values in a specific sequence of the same type of use
the same name. Data values in an array called array elements.
The location of the order of an array element indicated by a subscript or an index.
According to its dimensions, the array can be divided into:
A. One-dimensional array
oSetiap array element can be accessed via the index
oIndex array by default starts from 0
oDeklarasi array:
Tipe_array nama_array [size]
the same name. Data values in an array called array elements.
The location of the order of an array element indicated by a subscript or an index.
According to its dimensions, the array can be divided into:
A. One-dimensional array
oSetiap array element can be accessed via the index
oIndex array by default starts from 0
oDeklarasi array:
Tipe_array nama_array [size]
2. Two-dimensional arrays
Two-dimensional array is an array consisting of m rows and n fruit fruit fruit shaped columns can be either a matrix or table.
-Declaration of an array:
Tipe_array nama_array [row] [column]
Two-dimensional array is an array consisting of m rows and n fruit fruit fruit shaped columns can be either a matrix or table.
-Declaration of an array:
Tipe_array nama_array [row] [column]
3.Array multidimensional
Multidimensional array is an array, which has a size of more than two. Form a multidimensional array declaration is tantamount to the declaration of a one-dimensional array or two dimensional.
-Declaration of an array:
Tipe_array nama_array [size 1] [size 2]. . . [Size N]
Multidimensional array is an array, which has a size of more than two. Form a multidimensional array declaration is tantamount to the declaration of a one-dimensional array or two dimensional.
-Declaration of an array:
Tipe_array nama_array [size 1] [size 2]. . . [Size N]
Difference array with other data types:
Arrays can have some value, while other data types is only associated with a value only.
Arrays can be used to store some other data type value data (char, int, float, double, long, etc.) which is equal to one name only.
In addition, the array can be one or more dimensions, while the other data types is only a one-dimensional.
Arrays can have some value, while other data types is only associated with a value only.
Arrays can be used to store some other data type value data (char, int, float, double, long, etc.) which is equal to one name only.
In addition, the array can be one or more dimensions, while the other data types is only a one-dimensional.
Arrays can also be used as a parameter. Kind:
a. One-dimensional array as a parameter:
-Delivery parameters in the form of one-dimensional array is the delivery of reference / reference, because that is sent is the address of the first element arraynya, not all values elemenya. Address the first element of the array can be represented by a name that is not written lariknya indeknya.
a. One-dimensional array as a parameter:
-Delivery parameters in the form of one-dimensional array is the delivery of reference / reference, because that is sent is the address of the first element arraynya, not all values elemenya. Address the first element of the array can be represented by a name that is not written lariknya indeknya.
b.Array two dimensions as a parameter:
-Delivery parameters of two-dimensional array is similar to sending a one-dimensional array parameter, only difference is the two-dimensional array of rows and columns should mention the two-dimensional array, declared MAX_COLS MAX_ROWS and used for the delivery of two-dimensional array parameter and at the time of delivery formal parameters of a two-dimensional array, we should mention the many dimensions of the array to the columns, so the size of the column can be known, it is related to the ordering of variables in the memory array.
-Delivery parameters of two-dimensional array is similar to sending a one-dimensional array parameter, only difference is the two-dimensional array of rows and columns should mention the two-dimensional array, declared MAX_COLS MAX_ROWS and used for the delivery of two-dimensional array parameter and at the time of delivery formal parameters of a two-dimensional array, we should mention the many dimensions of the array to the columns, so the size of the column can be known, it is related to the ordering of variables in the memory array.
Tidak ada komentar:
Posting Komentar