Friday, May 16, 2008

Difference between arrays and pointers?

Array is an finite collection of similar data type.Which stores in the adjacent memory.
Eg:
int a[20].
Explanation:
This array carries 20 integer values.It occupies 40 bytes continuously.

Pointer is used to find the value of an address location.
Eg:
int *a;
Explanation:
In this the pointer variable 'a' have any address.If we declared that the variable pointer variable it stores value of that particular variable.

No comments:

Contributors