Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- char *ft_rot42(char *str)
- {
- int i;
- i = 0;
- while (str[i])
- {
- if (str[i] >= 'a' && str[i] <= 'z')
- str[i] = ((str[i] - 97 + 42) % 26) + 97;
- if (str[i] >= 'A' && str[i] <= 'Z')
- str[i] = ((str[i] - 65 + 42) % 26) + 65;
- ++i;
- }
- return (str);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement