Hey, so I'm writing a code for my Programming 1 class and its supposed to get a string(one word) from the user and a key, and then update and output the new string. So for example if the input is QUIZ and the key is 7, the output should be XBPG. For some reason my code is outputting double X and P for this string.
1)Your else block on line 23 is not proper,as there should be brackets around the block for the correct output to come.
2)You want to convert an int to char and a char to int,but you dont use correct casts and think the compiler will do the work for you.That type of implicit casts are risky to deal with,often heralding in cases where the output is not tht which is required.
Ohh I totally forgot the brackets thanks! And my bad, I assumed it would automatically switch back to char because the array was declared as a string data type.