+ 2
How can I use the "array"?
I could not answer it
2 Answers
+ 1
Arrays are being used when u have multiple variables of the same type to assign values to. Arrays are mostly used with loops and at the same time they are related to pointers.
using an array:-
int myArray [10] = {5, 47, 90, 23, 11, 89, 8, 2, 1, 3};
All the arrays are being assisgned in a single line . very simple and short.
Now, when you dont use arrays:-
int myArray0= 5;
int myArray1 = 47;
int myArray2 = 90;
int myArray3 = 23;
int myArray4 = 11;
int myArray5 = 89;
int myArray6 = 8;
int myArray7 = 2;
int myArray8 = 1;
int myArray9 = 3;
its really so stressful and lenghty when typing and assigning each variables one after the other.
+ 1
Thank u