What is array?not understandable | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

What is array?not understandable

i am not able to understand array please help me with this

8th Aug 2018, 5:26 PM
Mohit Tak
Mohit Tak - avatar
4 Answers
+ 2
we can hold only homogeneous(similar) type of value. Arrays are fixed in size.we can't increase or decrease the size of array.
8th Aug 2018, 10:54 PM
P∆WAN M∆URY∆
P∆WAN M∆URY∆ - avatar
+ 1
Array its list of smting value, variables ,strings
8th Aug 2018, 7:02 PM
The Ophiuchus
The Ophiuchus - avatar
0
please explain me more
9th Aug 2018, 6:45 AM
Mohit Tak
Mohit Tak - avatar
0
Arrays have a fixed size, meaning once you declare an array with a certain number of elements, you cannot increase or decrease the size of the array. Arrays also begin at 0 rather than 1. This means that in order to create an array with 5 elements, you must declare the array with a size of 4, or n-1, where n is the total number of elements you wish to include. For example, in the lines: string name = “John”; string name2 = “Jane”; string name3 = “Mary”; we have created 3 separate string variables with the values of “John”, “Jane”, and “Mary”. Since each “name” you create will be of the same data type (string), we can more efficiently create an array of strings rather than separate strings: string names[2] = {“John”, “Jane”, “Mary”}; The “[2]” indicates an array that will include 3 elements. Here we have declared 3 strings (0 = John, 1 = Jane, 2 = Mary). In order to access the name “John,” or the first element in the array, we would write names[0], the second element would be names[1], and so on. I apologize if I made this confusing, I hope I could help!
9th Aug 2018, 7:15 AM
NULL
NULL - avatar