I am writing a application for Arch Linux, actually I already wrote it, but I wanted to do it a little differently then the other. The origional one uses the goto statement. Here is the code:
#include <iostream>
#include <string>
using namespace std;
int main()
{
cout
<< "\tAurDown v2.1\n"
<< "\tLicense: GPL3\n\n"
<< "Menu\n"
<< "1. Search for package\n"
<< "2. Download a package\n";
cout << "Enter Selection\t";
cin >> nSel;
while((nSel != 1) || (nSel != 2))
{
cout << "Please Enter a valid selection"\n;
cin >> nSel;
}
}
I am wanting to it to print "Please enter a valid selection" as many times as somebody enters anything other than 1 or 2 and if the person enters 1 or two after they get the error "Please enter a valid...." it will resume. Sorry this is a newbie question. I know it has to be a simple problem, but can't find it.
Thanks