DEV Community

Discussion on: Why Array Index Starts with 0 , A pointers magic !

Collapse
 
pauljlucas profile image
Paul J. Lucas

arr[] -> arr is a special pointer that holds the First element address

No it isn't. A pointer has its own address in memory. The name of an array doesn't, so it is not any kind of pointer. A curious quirk of C is that mentioning the name of an array in most contexts causes the compiler to treat it as if it were a pointer to the first element — but that still doesn't make it a pointer.

Collapse
 
shrihari profile image
Shrihari Mohan

Thanks for making this blog more accurate , I will update and let you know. Yes in almost all contexts it is converted as pointer.