Why we use arrays?
We need to store multiple items and using variable it gets overridden. In order
to retain the multiples items of the same data type we will use arrays.
All the elements are stored in consecutive locations
Example:
int, float, string , char
Valid A int[60]- Size should be constant
Example: int[60]={435,435,55,56}
Access the data
Three types
1)One dimensional Array 2)Two-dimension 3)Multidimensional
Disadvantages:
1)Consumes memory as we are deciding the fixed amount of memory at the compile time. At run time you cannot exceed the size limit of array.
0 Comments