void booking()
{
int i=0;
char numstr[100];
HANDLE hStdOut = GetStdHandle(STD_OUTPUT_HANDLE);
SetConsoleTextAttribute(hStdOut,FOREGROUND_RED|FOREGROUND_GREEN|FOREGROUND_BLUE|FOREGROUND_INTENSITY);//Bright WHITE Color (text)
system("cls");
printf("++++++++++++++++++++++++++++++++++++++ Bus Reservation System TM2G ++++++++++++++++++++++++++++++++++++++\n\n\n");//for entering train number
table();//for seeing bus least
printf("Enter the Bus number:--->>>");
scanf("%d",&trno);
printf("++++++++++++++++++++++++++++++++++++++ Bus Reservation System TM2G ++++++++++++++++++++++++++++++++++++++\n\n\n");//for selecting coach
printf("Your Bus Number is %d ********** %s",trno,ch[trno-1]);
status_1(trno); //empty seat
FILE *f1, *fopen();//for reading the seats from the user.
char str1[80]="24",str2[4],str3[4];
int seat1,seat2,booking=0;
if(trno == 1)
{
f1 = fopen("tr1.txt","r+");
fgets(str1,80,f1);
fclose(f1);
}else if(trno == 2)
{
f1 = fopen("tr2.txt","r+");
fgets(str1,80,f1);
fclose(f1);
}else if(trno == 3)
{
f1 = fopen("tr3.txt","r+");
fgets(str1,80,f1);
fclose(f1);
}else if(trno == 4)
{
f1 = fopen("tr4.txt","r+");
fgets(str1,80,f1);
fclose(f1);
}else if(trno == 5)
{
f1 = fopen("tr5.txt","r+");
fgets(str1,80,f1);
fclose(f1);
}else if(trno == 6)
{
f1 = fopen("tr6.txt","r+");
fgets(str1,80,f1);
fclose(f1);
}
ช่วยดูโปรแกรมให้หน่อย ถ้าจะไม่ให้จองที่นั่งซ้ำต้องทำอย่างไร ภาษา C
{
int i=0;
char numstr[100];
HANDLE hStdOut = GetStdHandle(STD_OUTPUT_HANDLE);
SetConsoleTextAttribute(hStdOut,FOREGROUND_RED|FOREGROUND_GREEN|FOREGROUND_BLUE|FOREGROUND_INTENSITY);//Bright WHITE Color (text)
system("cls");
printf("++++++++++++++++++++++++++++++++++++++ Bus Reservation System TM2G ++++++++++++++++++++++++++++++++++++++\n\n\n");//for entering train number
table();//for seeing bus least
printf("Enter the Bus number:--->>>");
scanf("%d",&trno);
printf("++++++++++++++++++++++++++++++++++++++ Bus Reservation System TM2G ++++++++++++++++++++++++++++++++++++++\n\n\n");//for selecting coach
printf("Your Bus Number is %d ********** %s",trno,ch[trno-1]);
status_1(trno); //empty seat
FILE *f1, *fopen();//for reading the seats from the user.
char str1[80]="24",str2[4],str3[4];
int seat1,seat2,booking=0;
if(trno == 1)
{
f1 = fopen("tr1.txt","r+");
fgets(str1,80,f1);
fclose(f1);
}else if(trno == 2)
{
f1 = fopen("tr2.txt","r+");
fgets(str1,80,f1);
fclose(f1);
}else if(trno == 3)
{
f1 = fopen("tr3.txt","r+");
fgets(str1,80,f1);
fclose(f1);
}else if(trno == 4)
{
f1 = fopen("tr4.txt","r+");
fgets(str1,80,f1);
fclose(f1);
}else if(trno == 5)
{
f1 = fopen("tr5.txt","r+");
fgets(str1,80,f1);
fclose(f1);
}else if(trno == 6)
{
f1 = fopen("tr6.txt","r+");
fgets(str1,80,f1);
fclose(f1);
}