Asked by
Pankaj Kumar
in
Computers & Technology
at
6:55 PM on August 21, 2008
Prakash Kuma's Answer
Array ----------->>>
An Array is a collection of variables having similar data types and stored in adjacent memory locations.An ordinary variable is capable of storing only one value at a time.
However,there are situations where we would be wanting to store more than one value at a time in a single variable.
At that time we use Array and construct one variable (called as subscripted variable) capable of storing or holding multiple values.
Before using an array its type and size must be declared
For example :
int arr[90];
An array variable is defined using index or subscript which specifies the size of the variable ie, how many values it can store.
Pointer ia a variable but not an ordinary one ,it stores the address of other variable.
There are two operators which are mainly used in pointers one is the '&' known as "address of" operator. It returns the address of the variable
Suppose for example :
int i;
int *j;
j=&i;
Here j stores the address of variable "i".
The second operator is the '*' called "value at address " operator.It gives the value stored at a particular address. In the above example "j" is the pointer variable.
Answered at
7:23 PM on August 21, 2008
Read all answers