here is my function to take in the struct
and i want to check if there are any empty
seats not taken. DR Power seat 21
Code:
struct fast_line { // structure
char pass_name[ 30 ];
int seat_number;
};
Code:
struct fast_line record[] = { /** fill seats wth passengers **/
{ "DR Power", 21 },
{ "Green Lantern", 2 },
{ "The Flash" , 30 },
{ "Super Girl" , 7 },
{ "Phoenix", 12 },
{ "Clark Kent", 17 },
{ "The Tick" ,4 },
{ "Swamp Thing" , 26 }
};
Code:
void show_seats_taken( struct fast_line *rec )
{
int i, length;
int temp;
length = strlen(rec->pass_name);
for( i = 0; i < length; i++ )
printf( "Seat [%i] is assigned to %s \n\n", rec[ i ].seat_number , rec[ i ].pass_name );
if( rec[i].seat_number ==' ' ) // this is not working
{
temp = rec[i].seat_number;
printf("seat %i is available\n" , temp );
}
}
so im trying to find the empty spaces in the array of structs. there are 30 available how many are not filled..