5 votes
Accepted

Cannot Compile - Error Message: *** No rule to make target

From the view of the folder tree on the left we see that the .c files are in a directory under workspace named pset1. At the bottom we see that the compile is being run from the workspace directory. ...
user avatar
3 votes
Accepted

"Error: Expected identifier or '(' in cash.c

Hmmm... I don't see a main() declaration anywhere. [Edit] The problem in this question is probably the most fundamental part of learning to write a C program. You need to be able to understand how ...
user avatar
  • 64.2k
3 votes

CS50 Readability compile error

I believe the problem has nothing to do with ch. After editing the question, and rereading everything carefully, including the raw post in edit, here's where I see the problem. The first error is this:...
user avatar
  • 64.2k
2 votes

No such file or directory, pset1

It looks as though you don't have a full understanding of how directory structure works. Looking at the image that you posted, you have already created the subdirectory pset1 in the directory ~/...
user avatar
  • 64.2k
2 votes
Accepted

cs50.h - no such file or directory

Your code may be the same as David's but your environment is (drastically) different. You will possibly (probably?) have to make adjustments to all the courseware as you go along. In the IDE50 ...
user avatar
2 votes
Accepted

pset 3 plurality code help

for (int i = 0; i < candidate_count; i++) { if (candidates[i].votes >= maxvote) { maxvote = candidates[i].votes; winner = candidates[i].name; ...
user avatar
  • 711
1 vote
Accepted

Pset 3 plurality compiling error

First, remember that compilers are very dumb! They don't do logical analysis of code to determine that certain things can't happen (like the number of candidates being 0.) Now, with that in mind, you ...
user avatar
  • 64.2k
1 vote
Accepted

PSET5 Speller: Check50 Can't Compile: Exit code 2 vs 0

This is one of those rare circumstances where check50 actually is broken. Seems that a bug was introduced with the latest update. It's being rolled back as I type, and may well be working again as ...
user avatar
  • 64.2k
1 vote

PSET5 Speller: Check50 Can't Compile: Exit code 2 vs 0

been getting the same error since I started optimizing my solution today. Was working fine till today. Think this is a bug in check50.
user avatar
  • 11
1 vote
Accepted

caesar pset2 "expected expression and use of undeclared identifier" error

You have identified the variables correctly, but used your brackets and keywords wrongly. Inside the for loop, you open a if statement bracket but don't close. In your control_caesar_key function, you ...
user avatar
  • 992
1 vote
Accepted

CS50 readability.c:31:1: error: expected identifier or '(' {

Simple syntax error. int get_index(string s); This is the first line of the actual function, not a signature-only line. There should not be a semicolon. If this were a signature-only line at the top ...
user avatar
  • 64.2k
1 vote

pset3 plurality errors: expected expression if for

when casting data types, the cast keyword, in this case float, needs to be enclosed in parentheses. if( (float)...) If this answers your question, please click on the check mark to accept. Let's ...
user avatar
  • 64.2k
1 vote
Accepted

Cash.c:11:24: error: expected expression

#include <cs50.h> #include <math.h> int main(void) { int n = 0; do { n = (get_float("Change owed: ") * 100); } while (n < 0); int q = ((n / 25) % 10); //<- need ...
user avatar
  • 450
1 vote
Accepted

pset3 tideman failed to compile

Can't see your code, but the spec says: You should not modify anything else in tideman.c other than the implementations of the vote, record_preferences, add_pairs, sort_pairs, lock_pairs, and ...
user avatar
  • 18.4k
1 vote
Accepted

CS50 IDE cs50.h library problem 2017

The compiler command is make test (unless you want to supply all the switches for clang). Notice that make echos to the terminal the actual clang command it uses.
user avatar
1 vote

pset 3 plurality code help

Your code is incrementing maxvote every time your if statement is true.. The goal is to get the max number of votes and see then check if who are the candidates that have the same number of votes to ...
user avatar
  • 711
1 vote
Accepted

Cannot Compile Due to Error in cs50.h

The function signature has changed. From the CS50 Programmer's Manual char *get_string (const char *format, ...); DESCRIPTION Prompts user for a line of text from standard input and ...
user avatar
1 vote
Accepted

pset3 fifteen.c not working with check50: "expected exit code 0, not 1"

The fifteen.c file was distributed in the pset and was not supposed to be altered in any way. The only file that should be changed is helpers.c. Did you alter fifteen.c? Clearly, yes. That explains ...
user avatar
  • 64.2k
1 vote
Accepted

pset3 helpers.c ERROR

helpers.c does not contain a main function, so it cannot be compiled into an executable. Its code is used in find.c, make find instead of helpers, using either make find or clang -ggdb3 -O0 -std=...
user avatar
  • 20.7k
1 vote
Accepted

Pset5: not knowing why the errors occured

struct node* children[27] = {}; This is an error because this is part of a typedef. You can't assign values or initialize in a typedef. A typedef is not a variable, so it cannot be initialized. Once ...
user avatar
  • 64.2k
1 vote
Accepted

Pset 3 error - Binary search

It's what you are comparing that is giving you issues. You are comparing an array element to the array itself, values[x] > values. Or, to put it another way, you have the same typo (or a cut and ...
user avatar
  • 64.2k

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