+ 3

I can't understand array please helpful answer and description

help me

5th Nov 2018, 2:43 PM
Ochudho Cham Odiel
Ochudho Cham Odiel - avatar
2 ответов
+ 14
A collection of similar objects or variables of same data type is called an Array. Consider you need 100 variables for your program, one approach you can use is create variables - int a, b, c, ... so on which is not very feasible. Arrays allow you to do the same thing in a more structured and efficient manner. For the above example we would declare an array as - int arr[100]; This will create 100 indexed variables of type int for you to use. To access a specific element you have to use the index of that variable as a subscript. To access 10th variable , you would use arr[9] (Index of array starts from 0) Hope you understand!
5th Nov 2018, 3:10 PM
Aayush Bhansali
Aayush Bhansali - avatar
5th Nov 2018, 3:32 PM
Izaak GOLDSTEIN
Izaak GOLDSTEIN - avatar