Advertisement
RusNuker

Mass uppercaser for C char[] strings

Feb 13th, 2023
772
1
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.24 KB | None | 1 0
  1. // <3 <3 <3
  2. #define IS_INRANGE(num, a, b) ((a-1<num)&&(num<b+1))
  3.  
  4. void toUpperCase (char * string, int size) {
  5.     int temp;
  6.     for (int i = 0; i < size; ++i)
  7.     {
  8.         temp = string[i];
  9.         if (IS_INRANGE(temp, 97, 122))
  10.             string[i] = temp-32;
  11.     }
  12. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement