when does a array act as a pointer in c?

后端 未结 5 733
盖世英雄少女心
盖世英雄少女心 2021-01-15 08:34

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.

5条回答
  •  一生所求
    2021-01-15 09:02

    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..

提交回复
热议问题