So to pass the number of elements in the array, should that just be another argument to the function like this?
Code:
void flts_from(char dept_aport[4], flight flights[], int size) {
int counter;
for (counter = 0; counter < size; ++counter) {
if (strcmp(flights[counter].flt_orgin, dept_aport) == 0) {
printf("Flight %s\n", flights[counter].flt_no);
}
}
}
int main() {
int arraysize = 10;
flight flight_a[arraysize];
strcpy(flight_a[0].flt_no,"12432");
strcpy(flight_a[0].flt_orgin,"LAX");
strcpy(flight_a[1].flt_no,"55555");
strcpy(flight_a[1].flt_orgin,"BOS");
flts_from("BOS", flight_a, arraysize);
return(0);
}
No builtin to return the number of elements in the array ( or possible number of elements ... )?