i know that the array name could be used as a pointer(although it's a converted form), but my question is , Is there some other instance where array acts as a pointer.
Technically speaking, an array name never acts as a pointer. An expression with array type (which could be an array name) will convert to a pointer anytime an array type is not legal, but a pointer type is. And the declaration of an array as a function parameter is converted into a declaration of a pointer. (Which means that the name isn't an array name, but a pointer name. Despite appearances.)
It is due to array-to-pointer standard conversion. Specifically, array decays into a pointer to the first element of the array.
Array decays into a pointer, I think, because arrays and pointers are used exactly in the same way: using an index, which you can increment and decrement, to traverse the elements, in both direction, forward and backward..
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With