I think it should be
and
Code:
void printcars(struct car *info)
{
int x=0;
for(x=0;x<3;x++){
printf("make: %s\n", info[x].make);
printf("model: %s\n", info[x].model);
printf("year: %d\n", info[x].year);
printf("miles: %d\n\n", info[x].miles);
}
}
should be
Code:
void printcars(const struct car *info, size_t num_elem)
{
size_t x;
for(x=0;x<num_elem;x++){
printf("make: %s\n", info[x].make);
printf("model: %s\n", info[x].model);
printf("year: %d\n", info[x].year);
printf("miles: %d\n\n", info[x].miles);
}
}