Is there any difference between these two declarations?

c

Solution

There is no difference.

From the horse mouth:

(C99, 6.7.5.3p7) "A declaration of a parameter as "array of type" shall be adjusted to "qualified pointer to type", where the type qualifiers (if any) are those specified within the [ and ] of the array type derivation."

On the reasons to prefer one form over the other, it depends on the people. Here is what H&S says (on switching to `T *array` from `T arr[]`):

(H&S, 5.4.3 Array Bounds) "That would more accurately reflect the implementation but less clearly indicate the intent."

Problem

Possible Duplicate: Difference between passing array and array pointer into function in C I have been wondering this for a while, is there any difference between these two? ``` void f1(char *c); void f2(char c[]); ``` A common example is this: ``` int main(int argc, char **argv); int main(int argc, char *argv[]); ``` Are there any reasons to prefer one to the other, apart from artistic ones?

Original source

Related problems