I am having trouble with getting this to work I need pointed in the right direction. The user will input a command line integer to determine how many places the characters will be rotated. My problem is that I want all lower case and upper case to stay the same case along with keeping spaces and special characters untouched, only rotating the letters by the specified integer. I need to make sure that for example: the integer set is 1 and the character "Z" is entered in the string to be encrypted it needs to wrap back around to "A" instead of going to the next ASCII character "[" I have been trying to use the "%" operator but I might be using it wrong. I am not looking for someone to write the entire code for me and I know I could find my answer by looking at the source code of a working program but I am trying to figure as much of this out by myself but right now I am stumped and need a small bit of help. Thanks!
I finally got it to work I had the entire operation wrong this is what worked for me.
char encrypt = ('A' + ( ( (input[i] - 'A') + key ) % 26));
Before I was trying
char encrypt (input[i] + key) % 26;
Thanks for the fast answers!