Hot answers tagged

11 votes

Undefined reference to `GetString'

A library's header file (the one that ends with the .h extension) doesn't contain function definitions. Instead, it contains the library's resources that are available for you to use. These resources ...
user avatar
  • 17.4k
10 votes

Why does check50 fail with status code 400?

Status 400 usually refers to an error during the connection of your appliance to the "back-end" that controls the status of your requests. You can get such error for various reasons: 1 - ...
user avatar
  • 1,156
8 votes
Accepted

Implicit declaration of function 'topper' is invalid in C99

I really think that is because you didn't include the correct header file, toupper() is a function declared in ctype.h you need to include this header in the code. #include <ctype.h>
user avatar
  • 1,359
7 votes

Undefined reference to `GetString'

Did you compile it using make? If not (and why not?) did you remember to include the -lcs50 clang compile flag that links the library?
user avatar
  • 18.3k
7 votes

Undefined reference to `GetString'

Download the cs50 from: http://mirror.cs50.net/library50/c/library50-c-5.zip Extract it. (You will get two files cs50.c and cs50.h) Now copy both the files to your default library folder. (which ...
user avatar
7 votes

Can't submit or check

Had similar problem with similar message. This is how we found out what was wrong: Executed check50 -h to see what logging options there were. Discovered we can turn on debug logging using --log-...
user avatar
  • 170
6 votes

permission denied

You wrongly named your file, before issuing make command with your file you named practice, rename it to practice.c then compile and run it. Here are the steps you need to follow rename the file ...
user avatar
5 votes

Why does check50 fail with status code 400?

Did you update the CS50 appliance? Try running update50 in the terminal.
user avatar
5 votes

Undefined reference to `GetString'

I have had the same problem in CS50 2015 VMware appliance. I even include CS50.h library like that: #include<cs50.h> But I was keep getting error 1 of Undefined reference to `GetString' or '...
user avatar
5 votes
Accepted

implicit declaration of function is invalid in C99

Sorry, beginner error: But now if we try to print_name(s) in our main function, we still get an error. And that’s because the compiler reads from top to bottom, in order, so at the time main ...
user avatar
4 votes
Accepted

How to use strcmp correctly in PSET4? (Using it cause my whole program to stop)

You need to add if(object != NULL) before your if (object == paddle) Your program stops because of "Segmentation Fault". The Detect-Collision function returns a NULL if no object is detected. You ...
user avatar
  • 428
4 votes
Accepted

vigenere sometimes prints extra characters at the end of ciphertext in an unpredictable pattern

The problem comes because cipher is declared a char array here char cipher[strlen(plain)];, but printed out using a string (aka char*) format here printf("ciphertext: %s\n", cipher);. Remember, the ...
user avatar
3 votes
Accepted

compilation error multi-character character constant in caesar

Simple fix. Look at the line: int letter = 'plaintext[i]' ; You are trying to put the integer (ASCII) value of a letter stored at plaintext[i] into the variable letter. The idea is right, but look ...
user avatar
  • 63.1k
3 votes
Accepted

Stuck on PSet1: I have the correct output, but Check50 says it's wrong

check50 is not wrong! Please check this question for more information about check50. Make sure you're in the same directory as mario.c and this is the command you run to check your program with ...
user avatar
  • 17.4k
3 votes

Valgrind error in PSET6

When implementing a recursive function, the base case should be written first because it's the first thing that should be executed to determine whether there should be one more recursive call or not! ...
user avatar
  • 17.4k
3 votes

phpMyAdmin: "mysql extension missing" error

We all know that phpMyAdmin can be flaky sometimes. Unfortunately, I can't tell you how to fix it -- but I can tell you how to use mysql50 shell from the command line. Try stuff like this: mysql50 ...
user avatar
  • 3,035
3 votes

A wierd error in won function (fifteen)

the hint is in 1-2-3|4-5-6|0-7-8 ie 1 2 3 4 5 6 0 7 8 Your won function will say that's a winning position, which it isn't. That same sort of scenario doesn't occur during the 4x4 gameplay. To ...
user avatar
  • 18.3k
3 votes

did not find EOF Pset 1 mario. expected "##\n", not " ##\n"

In case of a height of zero (which is a valid height), your programme should print zero lines and exit. You probably reject zero as a height and ask again, the tester doesn't expect being prompted for ...
user avatar
  • 20.7k
3 votes
Accepted

Code Seems to Work but check50 says otherwise (pset2)

Double check your loop condition. Your output is showing that you are printing the null char that signifies the end of the string. Be sure that if you have a string "ab" (which, in memory is 'a', '...
user avatar
  • 18.3k
3 votes
Accepted

UndefinedBehaviorSanitizer:DEADLYSIGNAL, what does that mean?

It's a segmemtation fault. If this answers your question, please click on the check mark to accept. Let's keep up on forum maintenance. ;-)
user avatar
  • 63.1k
3 votes
Accepted

Pset3 - runoff - print_winner and find_min error

You return prematurely. Simply finding a vote count smaller than the max is not enough. You need to keep going until you've looked at all the candidates, and then return the smallest vote count. // ...
user avatar
2 votes
Accepted

Email host incorrect - SMTP server error 5.5.2, "need fully-qualified hostname"

You can't use Harvard's SMTP server unless you are on campus using Harvard's network. You need to use your own ISP's, as it explains in the instructions: // use your ISP's SMTP server (e.g., smtp....
user avatar
  • 18.3k
2 votes

permission denied

Try executing the following command in the terminal to change the permissions for filename chmod 700 filename
user avatar
  • 17.4k
2 votes

mario step 1 getting undeclared identifier error

You have initialised two integers of name x. Just declare "int x;" outside your do while loop, and within that loop you simply write "x = GetInt();". Writing "int x" twice and assigning it two ...
user avatar
  • 570
2 votes
Accepted

Valgrind error in PSET6

The cause you have pasted means that you are checking the value of a variable you didn't previously specify (most likely unloader -> children[i] != NULL). When creating a new node, you should ...
user avatar
  • 332
2 votes
Accepted

Pset2, initials.c, program runs but getting bizarre outputs.

You have 2 main problems. The first one is that s[i] is a character (typically an ASCII value). If you add/subtract 1 to/from that, this will do exactly that — adding/subtracting 1 to/from this value. ...
user avatar
  • 17.4k
2 votes
Accepted

check50 error in vigenere with baz and Hax0r2 argv

check50 has no bugs. Your sandbox results show only one error 'szz' rather than 'rby' inside this string Expecting the following on standard out — xoqmd, rby gflkp!\n ... but received the ...
user avatar
  • 18.3k
2 votes
Accepted

caesar--how do i make k an int? error "invalid operands to binary expression ('string' (aka 'char *' and 'int') in cipher section of code?

Hard to tell what you did without seeing the code, including the declaration for k and what you mean by "converted to an int". If you cast it as an int as in this, x = (int) k;, well, that only casts ...
user avatar
  • 63.1k
2 votes
Accepted

Why does "if (input[i] == " ")" throw an error of "incompatible integer to pointer conversion"?

It turns out that using double quotes vs single quotes makes a difference in C! Double quotes are used to wrap a STRING, while single quotes are used to wrap a CHARACTER. This is easy to remember if ...
user avatar
  • 253
2 votes

Debugging Webserver in C

GDB should be a very useful tool for debugging server. The waiting is the hardest part. Remember server will be waiting for input from a browser/curl to process something or waiting for gdb to ...
user avatar

Only top scored, non community-wiki answers of a minimum length are eligible