I'm really struggling with this pset. I know my code isn't 100% right yet but I compiled it to test it out and it eventually compiled without errors. But the problem I'm having is that it's testing the input at the command prompt fine but then after that the program just ends - it doesn't go to GetString - it just stops.
I put the printf("test") function in to see what was happening and it doesn't print that either so it's like it's missing the whole code block out.
int main(int argc, string argv[])
{
//checks for correct input of one argument
if (argc !=2)
{
printf("Please enter one word only after the ./vigenere command\n");
return 1;
}
//checks for alphabetical text
for (int i = 0; i < strlen(argv[1]); i++)
{
if (!isalpha(argv[1][i]))
printf("Please enter alphabetical characters only after the ./vigenere command\n");
return 1;
}
printf("test");
string text = GetString();
string key = argv[1];
int j = 0;
for (int i = 0; i < strlen(text); i++)
{
if (isalpha(text[i]))
{
//for uppercase ascii values
if (isupper(text[i]))
(rest of the code)
else
{
//if not an alpha returns the character unaltered
printf("%c", text[i]);
j++;
}
}
printf("\n");
return 0;
}
What am I missing?