Unit 2 Part 3
Unit 2 Part 3
• An array is an groups of elements that can be identifies as a similar types i.e array of integer
types ,array of floating types , array of Character types and so on.
• Array can be categorized into two part:
• Single Dimensional Array (1-D Array)
• Two Dimensional Array (2-D Array)
• Multi – Dimensional Array
• For example, if we have to store the marks of 4 or 5 students then we can easily store them by
creating 5 different variables but what if we want to store marks of 100 students or say 500
students then it becomes very challenging to create that numbers of variable and manage them.
Now, arrays come into the picture that can do it easily by just creating an array of the required
size.
• Indexing of an array starts from 0. It means the first element is stored at the 0th index, the second at
1st, and so on.
• Once an array is declared its size remains constant throughout the program.
• The size of the array in bytes can be determined by the sizeof operator using which we can also find
the number of elements in the array.
• We can find the size of the type of elements stored in an array by subtracting adjacent addresses.
Data_Type Array_Name[Size1][Size2]...[SizeN];
where,