sunslayer commented on a Page, C++ ROT13  -  May 27, 2010

instead of using a switch statement you can use the ASCII value of the character

void ROT13(char *text)
{
      for(;*text;text++)
      {
         if(*text>'A'&&*text<'N'||*text>'a'&&*text<'n')*text+=13;
            else if(*text>'M'&&*text<'Z'||*text>'m'&&*text<'z')*text-=13;
      }
}
 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.