I looked through stack exchange, and it helped me understand a different way of indexing though the keyword. But it is still the wrong output. This is the first part of my for loop. It looks right and makes sense to me, but the output is "Sgsg mg nu vvr pcfx av rmexsa ao." instead of "Negh zf av huf pcfx bt gzrwep oz."
for(int i = 0, j = 1, m = strlen(p); i < m; i++, j++)
{
if(isalpha(p[i]))
{
if(isupper(p[i]))
{
kl = strlen(argv[1]);
int answer1 = ((p[i] - 'A') + (argv[1][j % kl] - 'A')) %26 + 'A';
printf("%c",answer1);
/*
*The ASCII integer of A must be subtracted from the ith character in the plaintext in order to make
*that character 0 and then later added back in order to give its ASCII value back.
*/
}
Where am I going wrong?