Alphabetic characers

I'm working on a problem where I have to encrypt and decrypt the user's text.
The user choses to decrypt or encrypt, then he choses a number to shift the alphabet... but what i need to prevent my encryption to become a digit or character.. for example if the user's number is a negative number or 34..what i need to do?

Last edited on
Hey, Im making a program alike this and I think this might help.
for (int i = 0; i < text.length(); i++)
{			
text[i] = text[i] - key;
}
cout<<key;

Topic archived. No new replies allowed.