Difference Between Array and Pointer in c
Array V/S Pointer :
Array | Pointer |
1 . Array allocates space automatically. | 1 . It is explicit assigned to point to an allocated space. |
2 . It cannot be resized. | 2 . It can be resized using realloc ( ). |
3 . It cannot be reassigned. | 3 . It can be reassigned. |
4 . Sizeof(arrayname) gives the number of bytes occupied by the array. | 4 . Sizeof(p) returns the number of bytes used to store the pointer variable p. |
Subscribe to:
Post Comments
(
Atom
)
No comments :
Post a Comment