Friday, April 27, 2007

The difference between pointers and arrays

1) A pointer is a place in memory that keeps address of another place inside, while an array is a single, preallocated chunk of contiguous elements (all of the same type), fixed in size and location.

2) Array like pointers can't be initialized at definition like arrays.

3) When we allocate memory for a pointer to use it as a dynamic array. The memory can be resized or freed later. But this is not the case for arrays.