I'm getting undeclared identifier errors for the letter i in the first 3 lines of code below.(Note: I have only posted the second part of the code). My algo is possibly a bit messed up too so far but I am only getting errors for these three lines. Some advice as to a succinct way to declare the 'i's would be good. Is it possible to modify just these lines?
char original = word[i];
int num[i];
char cipher[i];
if (isalpha (original)) //verify original input not integers
{
printf("ciphertext: ");
num = atoi(argv[1]); //change original string to integers
for(int i=0; i<strlen(num[i]); i++)
{
if(isupper(original)) //if original characters are uppercase
{
cipher[i] = (word[i]) - num -65)) % 26 + 65;
printf("%c", cipher[i]);
}
else (islower(original)) //for lowercase characters
{
char cipher[i] = (original) + num - 97)) % 26 + 97;
printf("%c", cipher[i]);
}
//other remaining characters
else
printf(("%c", (original)); // or print them together
}
(Incidentally the code is supposed to convert code to numerical then apply a key then print as uppercase characters - confusing.)