i have seen in many posts "in of cases array names decay pointers".
can know in cases/expressions array name doesn't decay pointers first elements?
sure.
in c99 there 3 fundamental cases, namely:
when it's argument of
&(address-of) operator.when it's argument of
sizeofoperator.when it's string literal of type
char [n + 1]or wide string literal of typewchar_t [n + 1](nlength of string) used initialize array, inchar str[] = "foo";orwchar_t wstr[] = l"foo";.
furthermore, in c11, newly introduced alignof operator doesn't let array argument decay pointer either.
in c++, there additional rules, example, when it's passed reference.
Comments
Post a Comment