Told to do this by someone...
A'IGHT!
The problem: I had a yes/no case which, when someone entered no, was supposed to restart my loop, and when yes was entered it was supposed to.. skip to teh end of the loop.
It looked like this:
Code:
while (corrct != 'n' || corrct != 'N')
{
system("cls");
cout<<"Please enter the location for the "<<drvletter<<" drive to redirect to : ";
cin>>drvdir;
system("cls");
cout<<"The "<<drvletter<<" drive will redirect to "<<drvdir<<".\n";
cout<<"Is this correct? (y/n)\n";
cin>>corrct;
switch(corrct)
{
case 'y': case 'Y':
break;
case 'n': case 'N':
cout<<"Please enter the location again.\n";
system("pause");
system("cls");
continue;
break;
default:
cout<<"Invalid choice. Try again.\n";
system("pause");
system("cls");
continue;
break;
}
}
Now.. Discovering the only problem in that is the while part, I quickly got very excited and attempted to fix it by changing it to:
Code:
while (corrct == 'n' || corrct == 'N')
Which also, did not work... OF COURSE, that is because when the loop started, corrct was not set to 'n', therefore, it skipped the loop.
With a bit of help, I found that this:
Code:
while (corrct != 'y' || corrct != 'Y')
was the way forward.
And amazingly, that does actually work.
Sorry
