am trying to make a menu that have a restriction using alphabet.
and want to know how to implement a condition containing (ascii).
how do i make a condition that only accept certain letters to my entered by the
using namespace std;
cout<<"enter letter ";
if ((int)ascii >97 && (int)ascii <101)
cout<<"echoing...please enter a valid choice\n";
your code seems to working fine whats wrong with it?
oh yeah i just want to restrict the users choice from (a-e ) only..
you want the >= and <= comparisons respectively. You are only searching 98-100
@abstraction : what if 'b' is entered? will the condition fail? coz i want leters (a,b,c,d,and e) to be the valid input otherwise says "invalid input pease try again";
ok i will try .. very sorry for asking such stupid question..