Pointer vs Array in function definition: what is the difference between void fct1 (int * p) and void fct1 (int p [])?

I want to know what is the difference between

void fct1(int *p)

and

void fct1(int p[]) 

I know that both are pointers, but are there any differences

+5
source share
2 answers

There is absolutely no difference when using a function as a parameter. The compiler handles both forms equally.

+8
source

There is no difference. For completeness, here is what the standard says:

C99 standard 6.7.5.3 section 7

Declaring a parameter as a `` type array must be adjusted to a '' Qualified type pointer, ...

+2
source

All Articles