I kind of know what to do... just having a hard time getting my head around it! This is my thinking: once I have asked the user for some text to cipher, I need to check if the text is indeed alphabet, uppercase and lowercase. I then need to get the ASCII value of the text, then change it to the alphabetical index (1-26), apply the key, then translate back to ASCII Here's the code, which I know is missing stuff. I'm sort of stuck. Any help to get me back on the road...
for(int i = 0, n = strlen(text); i < n; i++)
{
if(isalpha(text[i])) //checks if text is indeed letters
{
if islower(text[i])
{
printf("%c", text[i]);
}
if isupper(text[i])
{
printf("%c", text[i]);
}