I'm trying to validate that user input is either s or h.  The 
following code compiles, but will not work.  If it matters, I'm using 
Dev C++.

char PayType;

while ((cin >> PayType) && (tolower(PayType)) && ((PayType != 's')||
(PayType !='h')))
{
}

If I remove one of the comparisons, the !='s' or !='h', it works, but 
not with both.  Any help would be appreciated.  I keep thinking it's 
something simple that I'm over looking, but I can't see it.

Reply via email to