And one more silly mistake
Code:
int printticket(void)
{
if (seat[a][b][c] == 0)
{
printf ("\nEnter Designation [Mr/Ms]: ");
scanf ("%s", &customers[a][b][c].desg);
printf ("\nEnter First name: ");
scanf ("%s", &customers[a][b][c].fname);
printf ("\nEnter Last name: ");
scanf ("%s", &customers[a][b][c].lname);
printf ("\nEnter IC number: ");
scanf ("%s", &customers[a][b][c].icnum);
seat[a][b][c] = 1;
seatcount = seatcount+1;
customers[a][b][c].seat = seatcount;
printf ("\nName: %s. %s %s", customers[a][b][c].desg, customers[a][b][c].fname, customers[a][b][c].lname);
printf ("\nIC Number: %s", customers[a][b][c].icnum);
printf ("\nSeat Number: %s", customers[a][b][c].seat);
}
return seatcount;
}
In the above function customers[a][b][c].seat is of type int and you are using %s for it i think you should use %d otherwise it will give seg fault
Code:
int printticket(void)
{
if (seat[a][b][c] == 0)
{
printf ("\nEnter Designation [Mr/Ms]: ");
scanf ("%s", &customers[a][b][c].desg);
printf ("\nEnter First name: ");
scanf ("%s", &customers[a][b][c].fname);
printf ("\nEnter Last name: ");
scanf ("%s", &customers[a][b][c].lname);
printf ("\nEnter IC number: ");
scanf ("%s", &customers[a][b][c].icnum);
seat[a][b][c] = 1;
seatcount = seatcount+1;
customers[a][b][c].seat = seatcount;
printf ("\nName: %s. %s %s", customers[a][b][c].desg, customers[a][b][c].fname, customers[a][b][c].lname);
printf ("\nIC Number: %s", customers[a][b][c].icnum);
printf ("\nSeat Number: %d", customers[a][b][c].seat);
}
return seatcount;
}