I'm trying to pass an int array as a pointer to a function. I'm currently getting the following error: expected 'int (*)[100]' but argument is of type 'int *' void.
void count_frequency(int *number) {
int i;
int len = sizeof number / sizeof(int);
printf("%i\n", len);
printf("reached here");
for(i = 0; i < len; i++){
printf("%i\n", &number[i]);
}
}
int main(){
int i;
int table[MAX];
int len = sizeof table / sizeof(int);
printf("reached before loop\n");
for(i = 0; i < len; i++){
table[i] = random_in_range(0, 20);
}
count_frequency(table);
//printf("%i", sizeof(table) / sizeof(int));
return 0;
}