no when i add it to my entire program, it wont work. I will get a messgae saying that when i press Y its invalid and then after i use y it will proceed.
But if i restart the program and choose y i still get an error message
When i select option 2, and press Y i get the error message, if then press y, it will proceed to next line of code, however if i restart the program and go to option 2 and press y i get another error message
Well, as in it is waiting for something? Like _ ? Let's see it dude maybe I can help no promises I will look though if you post soon. The program I mean like where your putting it.
Thats the link to my full code, now the problem i have is placed into a function called validate() which is at the bottom. Now i have read that global variables are evil, which at the moment i am using loads. Could this be the problem?
int main()
{
int choice;
char ans;
bool charvalid=false;
//======================Menu===================================
do
{
banner();
//Prints out menu option
cout<<"Welcome to the conference booking system:\n\n";
cout<<"Option 1: Book A Seat\n";
cout<<"Option 2: View Seating Plan\n";
cout<<"Option 3: Exit\n\n";
cout<<"Please choose an option: ";
cin>>choice;
switch(choice)
{//Switch Open
case 1://book seat
{
system ("cls");
seatingPlan();
bookSeat();
break;
}
case 2://View seat plan
{
system ("cls");
seatingPlan();
seatPlan[row-1][convert-65];
cout<<"Would you like to view the delegates, that have booked? (Y/N): ";
cin>>ans;
if(ans=='Y' && ans=='y')
{
delegates();
}
break;
}
case 3: //exit
{
cout<<"";
return 0;
break;
}
default: cout<<"Thank you for using This Booking System\n";
break;
}//switch closed
cout<<"Do you want to return to main menu (Y/N): ";
cin>>ans;
system ("cls");
}while (ans='Y'|| ans=='y');// Loops back to the main menu