
Array means collection. An aaray is used to store elements of the same type. It is a very popular and useful data structure and stores elements in contiguous locations. More than one element is arranged in sequence so it is also called a composite data structure.
Array is a liner and homogenous data structure. Homogenous means that the same types of elements are stored in it. It can be combined with a non-homogenous structure and a complex data structure can be created.
For example, when we declare a variable,
int x;
The variable x is declared and a memory location of two bytes is allocated to it. Later, a single value can be stored in it.
Every variable has a name, value and memory location. Hence, from the above, we can say that only value can be stored in a variable.
0 comments:
Post a Comment