[Solved] find the input is alphanumeric or not with using #define macro preprocessor in c


Here is the macro:

#define IS_ALNUM(x) (((x)>='a' && (x) <= 'z')) ||((x)>='A' && (x) <= 'Z')) || (((x)>='0' && (x) <= '9')))

It tests if it is

  • Between a and z
  • Between A and Z
  • Between 0 and 9

Quite simple

2

solved find the input is alphanumeric or not with using #define macro preprocessor in c