Finding vowel using bit-manip

Rajrishi Vishwakarma - Aug 22 '20 - - Dev Community

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
. . .