array declare,initializing,1D array, 2D array

Publicado em: 13 Julho 2020
no canal de: Rezoana Ahmed Samira
24
0

Declaring Arrays
Array variables are declared identically to variables of their data type, except that the variable name is followed by one pair of square [ ] brackets for each dimension of the array.
one dimensional array:
one dimensional array is like a type of linear array. aacessing it's elements involves a single subscript which can either represent a row or column index.
data type_ array name_[size];
int array[5] = {1,2,3,4,5}// initializing

Initializing Arrays
Arrays may be initialized when they are declared, just as any other variables.
Place the initialization data in curly {} braces following the equals sign. 
The syntax to declare the 2D array is given below

data_type array_name [rows][columns];  
Consider the following example.
int twodimen [4][3]; 
Here, 4 is the number of rows, and 3 is the number of columns.

We will have to define at least the second dimension of the array. The two-dimensional array can be declared and initialize in the following way.
int arr [4][3]={{1,2,3},{2,3,4},{3,4,5},{4,5,6}};


Nesta página do site você pode assistir ao vídeo on-line array declare,initializing,1D array, 2D array duração hora minuto segundo em boa qualidade , que foi baixado pelo usuário Rezoana Ahmed Samira 13 Julho 2020, compartilhe o link com seus amigos e conhecidos, no youtube este vídeo já foi visto 24 vezes e gostou 0 espectadores. Boa visualização!