Hi im trying to use a function to initialize an array with random number. somehow i get this error that i couldnt be able to solve
void arrayInit(int *A, int n){
int i;
for ( i = 0; i < n; ++i)
{
A[i] = rand();
}
}
call arrayInit() in main
int main(void){
int array1[1000];
arrayInit(&array1, 1000);
return 0;
}
I get error saying:
csort.c:62:13: warning: passing argument 1 of ‘arrayInit’ from incompatible pointer type
arrayInit(&array1, 1000);
^
csort.c:8:6: note: expected ‘int *’ but argument is of type ‘int (*)[1000]’
void arrayInit(int *A, int n){
^