Advertisement
Guest User

Untitled

a guest
Dec 6th, 2016
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. static inline unsigned char __tolower(unsigned char c)
  2. {
  3. if (isupper(c))
  4. c -= 'A'-'a';
  5. return c;
  6. }
  7.  
  8.  
  9. static inline unsigned char __toupper(unsigned char c)
  10. {
  11. if (islower(c))
  12. c -= 'a'-'A';
  13. return c;
  14. }
  15.  
  16. c -= 'A'-'a'; ----> c = c ^ 0x20 ; //using xor to convert to lower case to upper case and vice versa
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement