I´m trying to solve this pset but I got stuck with function declaration. I did everything according to the tutorial but the clang keeps showing an error: "control reaches end of non-void function" on the very last line. Also I don´t quite get the declaring of for loop. Firsty, I use a comma and then two semicolons. Why not all either of them? I was a bit stuck because of this. Thank you
#include <cs50.h>
#include <stdio.h>
#include <string.h>
#include <ctype.h>
int shift(char c);
int main(int argc, string argv[])
{
if (argc != 2)
{
printf("Usage: ./vigenere keyword\n");
return 1;
}
for (int i = 0, n = strlen(argv[1]); i < n; i++)
{
if isalpha(argv[1][i])
{
int key = shift(argv[1][0]);
printf("%i\n", key);
return 0;
}
else
{
printf("Usage: ./vigenere keyword\n");
return 1;
}
}
}
int shift(char c)
{
// TODO
}