The pointer and array appears to be the same but there are many major difference between them.
- In array, the sizeof operator returns the total memory stored by the array.
In pointer, the sizeof operator returns the memory of pointer variable alone.
- In array, the & operator will provide the address of the first element.
In pointer, the & operator will provide the address of the pointer variable.
- Char array=”abc” stes the first four elements in array to ‘a’,’b’,’c’ and ”.
char *pointer=”abc” sets the pointer to the address of the “abc” string(Which may be stored in read-only memory and so its unchangeable).