(Main question- need help on this for code to work! highlighted in screenshot.) My PSET2 code works fine up until asking the user to input plaintext, but becomes funky and outputs blank spaces as the ciphertext. Is there anything wrong with the printf format/enciphering formula?
(more optional) I want to print an error message if the user does not input a valid alphabetic word into argv1 reading Invalid Keyword, but this message currently prints as many times as the number of invalid characters rather than just once. I believe this is because printf("Invalid Keyword") is inside the for loop, but I haven't been able to successfully place it outside the for loop as it needs the variable 'a' of the loop to work properly, also it isn't logical to place it outside !isalpha. I just can't figure out how to properly declare it outside the for loop.
(more optional) On a similar note to 2, my variable m and a seem to be the same thing, but again can't really figure out how best to declare it just once outside globally as I believe I would still need to write an initialisaiton, condition, and increment for their respective for loops. Again, I'm sure it would work if I declare them both, but maybe if I can figure out a way to not do so if not necessary I can shorten my code.
Thank you so much for any help in advance, I highly appreciate it!