Array |
||||
51 views
An array is a collection of objects of the same data type. The subscripting operator ([]) provides the mechanics for creating an index to array elements. This form of access is called indexing or subscripting. An array facilitates the coding of repetitive tasks by allowing the statements executed on each element to be put into a loop that iterates through each element in the array. Consider the case where a programmer needs to keep track of a number of people within an organisation. So far, our initial attempt will be to create a specific variable for each user. int name1 = 101; This is okay, but what if you needed a thousand integers? An easier way is to declare an array of five integers int a[5]; Example : #include <stdio.h>main() char str[16]=”Blueberry”;
|
| « Dimension | HTML History » |
| Posted on Monday, June 16th, 2008 at 4:57 pm under C For Beginners | RSS 2.0 Feed | |