Having trouble passing array of structures to a function
As the title says, I'm having an issue passing an array of structures to a function.The structure reads and tokenises information from a text file. I then need to do things with that data using several different functions. Here's my code:
int count = 0;
ptr_cars = fopen("cars.txt", "r");
while ( fgets ( line, sizeof line, ptr_cars ) != NULL )
nextWordPtr = strtok(line2,";");
and so on for each struct variable...
int choice = 0;
while(choice != 7)
if(choice == 3) listrented(cars_t cars);
When choice 3 is entered, following function is called:
int listrented(cars_t cars2)
A simple as a function can be. It's in a separate .c file, maintained in the same project using CodeBlocks. The error that I get is:
error: expected ')' before 'cars2'
Huh? I'm not sure why that's appearing at all. Being able to pass this array of structures to a function would be great, and if anyone could help me out, I would definitely appreciate it.