Link to home
Start Free TrialLog in
Avatar of star90
star90

asked on

How to check if a char belongs to a group of chars, C solution.

Hi,
I want to know how can I check if a char belongs to a group of chars.
for example:
char a;
if (  (a=='1') || (a=='2') || (a=='3') || (A=='4')  || (a=='5') || (a=='6')||(a=='7') || (A=='8') )
 {; }

Is there a way to write it in a short way by defining a group of chars and checking if char a belongs to this group?
The solution has to be in C.
Thanks!
ASKER CERTIFIED SOLUTION
Avatar of Kent Olsen
Kent Olsen
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of star90
star90

ASKER

Hi Kdo.
Thaks for your answer!
star90