Well neither at the moment, since it doesn't compile.
Code:
$ gcc foo.c
foo.c: In function ‘main’:
foo.c:12:8: warning: passing argument 1 of ‘foo’ makes integer from pointer without a cast [-Wint-conversion]
12 | foo(array);
| ^~~~~
| |
| int *
foo.c:3:16: note: expected ‘int’ but argument is of type ‘int *’
3 | void foo ( int p )
| ~~~~^
Consider one of
An address.
Code:
#include<stdio.h>
void foo ( int *p )
{
printf(" %d", *p);
}
int main(void) {
int array[] = {1, 2, 3, 4, 5};
foo(array);
return 0;
}
A value.
Code:
#include<stdio.h>
void foo ( int p )
{
printf(" %d", p);
}
int main(void) {
int array[] = {1, 2, 3, 4, 5};
foo(array[0]);
return 0;
}