when does a array act as a pointer in c?

后端 未结 5 740
盖世英雄少女心
盖世英雄少女心 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:12

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

提交回复
热议问题