The code works fine I\'m just worried about the warning messages I\'m getting, would there be a way to make them not appear? Is there any reason to be worried about them? Also f
I think the error message is pretty self-describing.
In your code, a
is an array type, having int [10]
. You pass &a
, which is of type pointer to an array of 10 int
s, or, int (*)[10]
which is not the same type as a pointer to int
, i.e., int *
. Hence the compiler screams.
As array type variables decay to the pointer to the first element of the array while passed as function arguments, you should call your function like
readarray(a);