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

Veröffentlicht am: 13 Juli 2020
auf dem Kanal: 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}};


Auf dieser Seite können Sie das Online-Video array declare,initializing,1D array, 2D array mit der Dauer stunde minuten sekunde in guter Qualität ansehen, das der Benutzer Rezoana Ahmed Samira 13 Juli 2020 hochgeladen hat, den Link mit Freunden und Bekannten teilen, dieses Video wurde auf Youtube bereits 24 Mal angesehen und es wurde von 0 den Zuschauern gefallen. Viel Spaß beim Betrachtenden Zuschauern gefallen!