I keep getting a seg fault when I run vigenere with a keyword, I think I may be using the isalpha() function incorrectly, please can someone take a look and give me some pointers pls? Below are a couple of lines of code to help get to the root of the problem:
int key = atoi(argv[1]);
char letr[key];
for (int c = 0, p = strlen(plaintext); c < p; c++)
{
for(int j = 0, k = strlen(argv[1]); j < k; j++)
{
if (isupper(letr[c]))
{
printf("%c", (plaintext[key] - 65 + key) % 26 + 65);
Pls also let me know if you spot any potential pitfalls with my formula.
Many thanks