Firstly, i press ENTER to exit the 1st do..while loop
and then the programe ask Rent Paid(y/n):
if i press n and then ENTER,
the program return rent_step2,
and it is supposed to wait for me before i press ENTER again
But it just break the 1st do..while loop and not waiting for me pressing ENTER
it skips to ask Rent Paid(y/n):
so how can i solve this problem....
I have also uploaded all of the source code
void rent_locker(){
rent_step1:
//................
rent_step2:
do{
if(GetAsyncKeyState(VK_UP) != 0){
//................
}else if(GetAsyncKeyState(VK_DOWN) != 0){
//................
}else if(GetAsyncKeyState(VK_LEFT) != 0){
//................
}else if(GetAsyncKeyState(VK_RIGHT) != 0){
//................
}else if(GetAsyncKeyState(8) != 0){
goto rent_step1;
}
//................
Sleep(300);
}while(!(GetAsyncKeyState(13)));
rent_step3:
char confirm[10];
confirm[0]='u';
do{
cout << "Rent Paid(y/n): ";
cin >> confirm;
}while(strlen(confirm)>1 || !(confirm[0]=='y'||confirm[0]=='Y'||
confirm[0]=='n'||confirm[0]=='N'));
if(confirm[0]=='y' || confirm[0]=='Y'){
cout << "*** PAID!!! ***";
}else if(confirm[0]=='n' || confirm[0]=='N'){
confirm[0]='u';
goto rent_step2;
}
system("pause");
return;
}