/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* ft_rot42.c :+: :+: :+: */ /* +:+ +:+ +:+ */ /* By: gtertysh +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2016/11/03 21:58:10 by gtertysh #+# #+# */ /* Updated: 2016/11/04 02:01:11 by gtertysh ### ########.fr */ /* */ /* ************************************************************************** */ char *ft_rot42(char *str) { char *begin; begin = str; while (*str) { if (*str >= 'A' && *str <= 'Z') *str = (*str - 65 + 42) % 26 + 65; else if (*str >= 'a' && *str <= 'z') *str = (*str - 97 + 42) % 26 + 97; str++; } return (begin); }