I'm at my wits' end. My code for vigenere compiles fine using make vigenere within CS50 IDE. However, when I run check50, I get this:

:) vigenere.c exists.

:( vigenere.c compiles. expected exit code 0, not 1

See https://cs50.me/checks/a9cd3b82d84e1b6d137c44df91b8a5810ad14776 for more detail.

...and it won't run any of the other tests because of this first error.

The only thing shown under the log for the error is this: Log running clang -o vigenere vigenere.c -lcs50 -lm... checking that program exited with status 0...

I have no idea why this is happening, since I have in fact compiled this code successfully, and have tested the manually using "bacon" / "Meet me in the park at eleven am", and all of the tests in check50 with barfoo, baz, and such. For every test, the code seemed to be working correctly. The only thing I can think of is whether I may have done something wrong with one or both of my functions; this is the first code I've written where I've added my own functions.

Here's my code:

// Encrypts text using the vigenere cipher.

#include <cs50.h>
#include <ctype.h>
#include <stdlib.h>
#include <string.h>
#include <stdio.h>

#define LOWER 97
#define UPPER 65
#define ALPHA 26

// Call index function, which will convert character in encryption code text to an index 0 - 25 to avoid case issues.
int index(int c);

[code snipped]

Any help you can give is greatly appreciated.


Change your function to a name other than index. Looks like that is getting confused with the index declaration in string.h.

(check50 is running a different compile version, which I'll see about fixing).

  • Yep, that did it! Thank you! – eniemiec Feb 12 '18 at 1:24

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .