I am at the point in pset2 Vinegere, where I have to write the shift function. The tutorial (or guidance on the left side in sandbox) is telling me to place the following line of code after the curled brace of main:
int shift(char c)
{
// TODO
}
However, when I tried to compile, I got the answer:
vigenere.c:52:1: error: control reaches end of non-void function [-Werror,-Wreturn-type]
}
^
I tried to fill in the //TODO
and came to the following code:
int shift(char c)
{
for (int i = 0; i < c; i++)
if isupper(shift)
{
printf("%i", (shift-65) % 26);
}
else if islower(shift)
{
printf("%i", (shift-97) % 26);
}
else
{
printf("%i", shift);
}
}
However, this seems not to work either.
Can anybody help me on this please? I can't my mistakes.
Kind Regards,
Nisanth