One of the lines of my code is this -
if (isupper(plaintext[j]))
{
int cap_end = (plaintext[j] - (int) 'A' + atoi(argv[1]))%26 + (int) 'A';
printf("%c", (char) cap_end);
}
This lines compines however here I am trying to do something which Brian mentioned in the Walkthrough and that is to convert ASCII Index to Alphabet Index. However plaintext[j] is a string and I am subtracting a int from it shouldn't it not work? As the string a array of chars so shouldn't I need to convert it into a int first to use or does C do it for me and if does then why do I need to write A like the way I have done? I tried simply subtracting A or 'A' and it didn't work. Also (int) A didn't work only (int) 'A' worked is there a reason behind the ' ' used around A?