What are the Array?How to define and declare them?

What are the Array?How to define and declare them?

Basically Array are the collection of same data type.It has common name and addressed as a group.

Declaration of an Array:
We have to declare Array also as a single data object.
int Array[10];
 In this array of integers are created.Than first member in the array are addressed as Array[0] and last member has been declared as Array[9].
#define MAX_SIZE 10
int Array[MAX_SIZE];
int n;
for (n = 1; n <= MAX_SIZE; n++)
   Array[n] = n;

Definition of an Array:
We know that we declare an array like that,
int Array[10];
  When an array is external, it must be defined
in any other source files that may need to access it. Because you don�t want the compiler
to reallocate the storage for an array, you must tell the compiler that the array is allocated externally and that you want only to access the array.

By:Vivek Kr. Agarwal
Date:2007-01-09 00:00:00

Post Your Answers

User Email:

User Name:

Related C Subjective Links

C Subjective interview questions and answers for experienced and fresher