DEV Community

RajRishi Vishwakarma
RajRishi Vishwakarma

Posted on

Finding vowel using bit-manip

Below function returns, if passes character is vowel or not.
This is done by using Pete Becker's table of bit masking.

bool isvowel(char ch){
   return (0x208222>>(ch&0x1f))&1;
}
Enter fullscreen mode Exit fullscreen mode

Top comments (0)