An array in C language is a collection of similar data-type, means an array can hold value of a particular data type for which it has been declared.
Arrays can be created from any of the C data-types int, float, and char. So an integer array can only hold integer values and cannot hold values other than integer.
When we declare array, it allocates contiguous memory location for storing values whereas 2 or 3 variables of same data-type can have random locations.
So this is the most important difference between a variable and an array.
Types of Arrays:
No comments:
Post a Comment