I have an array of structures:
typedef struct
{
char name[20];
int ID;
int status;
} seat;
Then, basically, I'm trying to print out the list of empty seats in a reservation system.
void listEmpty(seat plane[MAXCAP]) {
int i;
for(i = 0; i < MAXCAP; i++) {
if(plane[i].status == 1) {
printf("Seat ID %d\n", plane[i].ID);
}
}
}
plan[i].status == 1
indicates that the seat is empty. However, when it prints out, it prints out some weird long integers instead of Seat ID 1 to Seat ID 12. May I know where I have gone wrong?
The correct output should be to display Seat ID 1 to Seat ID 12 instead of these weird long integers. Thanks!