All Questions

Filter by
Sorted by
Tagged with
1
vote
3answers
58 views

Need help with downloading videos for pset 7

I need help with downloading embedded videos for pset7. I did go to the CS50.tv website, but they do not contain all the videos that are embedded in the pset specs (for instance, the playlist that ...
0
votes
3answers
637 views

do while loop not working?

I used these condition in do while loop , and I still getting the forever loop. It just doesn't stop. while( x > 0 || x < 23);
0
votes
3answers
7k views

How to Check Whether a String Contains Non-Alphabetical Characters?

I'm stuck when I'm trying to identify whether the command-line argument input contains only alphabetical chars. Here's my code: When I tried to run the program, it showed an error message. I don't ...
1
vote
3answers
741 views

Can I get a new license for VMware Fusion?

I have an expired VMware Fusion license from last year. Can I get a new license? Do I have to pay for one?
1
vote
2answers
277 views

Why should we mod a hash value by the size of the hash table?

Week 7 Short on Hash Table provides the following suggested hash function: int hash_function (char* key) { // hash on first letter of string int hash = toupper(key[0]) - 'A' ; return hash ...
0
votes
1answer
100 views

Appliance fails to boot

I have successfully imported the appliance into VirtualBox, but the appliance fails to boot up, it just stops booting and continues to be in the same stage. At the right bottom appears the message "...
1
vote
2answers
121 views

pset7: query function arguments

In functions.php, the query function signature is such: function query(/* $sql [, ... ] */) I understand that the [,...] means optional arguements but I do not get why it is surrounded by the ...
-1
votes
1answer
372 views

What's Wrong in My Code for Vigenere?

Here's my pseudocode for vigenere cipher: for (i from 0 till strlen(s)) { if(ith letter is capital) { s[i] = s[i] + key[i % length of key-string] - 65 print s[i] (after checking if ...
6
votes
4answers
14k views

Where can I get CS50 textbooks?

Where can I get CS50's recommended list of books? Absolute Beginner’s Guide to C, Second Edition by Greg Perry Programming in C, Third Edition by Stephen Kochan How Computers Work, Ninth Edition by ...
0
votes
1answer
475 views

Can't submit pset1 assignment

I've completed the assignment for pset1. I have followed the directions for submitting the assignments. However, when I try to sign in to submit my assignments I get the following message, "You aren'...
0
votes
3answers
2k views

implicit declaration of function 'getint' is invalid in C99

I am getting an error as implicit declaration of function 'GetInt' is invalid in C99 when I, am using GetInt() in my program. Please can anybody help.
1
vote
2answers
122 views

Why “make” doesn't throw error when I include some libraries like “string.h”?

Why doesn't make throw an error when I include some libraries like string.h? make uses options such as -lcs50 and -lm to link the object files for header file cs50.h and math.h. For example, the ...
0
votes
2answers
2k views

pset1 error: expected 'while' in do/while loop [duplicate]

I am getting a strange error. What does it mean? I moved stuff around and changed stuff but it won't stop. #include <stdio.h> #include <cs50.h> int main(void) { int num; { ...
1
vote
1answer
23k views

C syntax errors like “expected expression”

I completed an introduction to programming using Python and I am more used to Python then C, so I might mix the two up. C is giving me all kinds of errors. I tried changing things but noting seems to ...
0
votes
2answers
504 views

“Killed by server” at the check50 test: rejects negative input like -.1

When I upload my program to check50, everything is green except I get this one error: :( rejects a negative input like -.1 \ killed by server What do I need to do to fix this?
5
votes
5answers
27k views

Can you print more than one char in C by using “x” * 5 like you can in Python?

In Python you can have a print statement print out a number of the same char by using print("X" * 5) which will give you XXXXX. Can this be done in C with printf?
0
votes
2answers
203 views

Can't find the saved file

In pset1 , following the instructions I wrote the hello.c file and saved it in the pset1 directory under Dropbox but when I go to the directory , I can't find the saved file. It also doesn't list when ...
0
votes
1answer
453 views

Can't download .zip file for pset3

I have problems downloading the pset3.zip file according to HTML specifications for problem set 3. I have tried running update50, connect50, I have logged off and back in again. The terminal isn't ...
0
votes
3answers
127 views

my windows 8.1 will not support the cs50 appliance?

I was able to download the VMware player but I can't change the bios settings that would allow me to open it with windows 8.1... is there an alternative program that we can use?
3
votes
2answers
504 views

Bricks aren't disappearing when hit with the ball

I wrote the following code (within the while loop) but my bricks aren't disappearing. My ball just hits the bricks and bounces off. What am I missing here? GObject object = detectCollision(window, ...
0
votes
1answer
433 views

Pset 3 - find.c is not working

I have compiled find.c, generate.c and helpers.c. When I compile make all, I get the following error message: jharvard@appliance (~/Dropbox/pset3/find): make all clang -ggdb3 -O0 -std=c99 -Wall -...
0
votes
1answer
371 views

fread reaches eof prematurely (pset 5)

Scratching my head on this one folks. My current program reads the first two chunks of 512 bytes of the first jpg (thats actually 3 reads total as the first 512 chunk is empty), but then fread fails ...
4
votes
1answer
246 views

Computing speed difference between n++ and n=n+1 in C

I am curious to know the computing speed difference between n++ and n=n+1 in C. I found a rather lengthy discussion on Stack Overflow, where some people are literally contradicting each other. To ...
0
votes
4answers
664 views

How to make ball initially go at random angle?

I don't want to have my ball go at a random velocity when it starts, just a random angle with respect to x. The specs say to use drand48, which I tried, but that makes the ball go really slowly or ...
1
vote
1answer
556 views

where is the Debugger in Gedit for C

I have been having some trouble writing my programs. I have been trying to find the debugger for c to speed up the process, but I have not succeeded. If you have found it can you please tell me where ...
2
votes
3answers
739 views

Can't access local host. Forbidden

I am typing out and following along with Week 9 codes as shown in lecture. When i remove index.html and index.php from my directory, i expect to see list of files when i run http:// localhost in ...
0
votes
4answers
953 views

How to Encrypt Plaintext Properly When it Contains Non-Alphabetical Chars?

My caesar.c doesn't encrypt plaintext properly when there are non-alphabetical chars in my plaintext word. Here's my code for encryption: int k = atoi(argv[1]); string plain_text = GetString(); // ...
1
vote
2answers
2k views

Is a Semicolon Required After main()'s Signature?

When trying to compile my mario.c and greedy.c programs, Clang compiler error messages indicate that a semicolon is needed after int main(void). The C book that I am using (i.e., C Step by Step by ...
0
votes
1answer
90 views

dropoff() stops when I assign a null value

For some reason, every time my code comes to this line of code, shuttle.seats[passenger]=null; it executed that line, but does not continue on. This is the line of code in context: for (passenger ...
2
votes
1answer
229 views

PSET8 Can't add property to the object array

In populate() function of service.js, I was trying to build an object array to store the passengers' name, house, placemark and marker. Basically, I created a global array, say database[], then when ...
1
vote
1answer
274 views

won() Doesn't Work Properly

My won() function works properly when the board dimensions are 3 x 3. However, it doesn't work properly when the board dimensions are 4 x 4. What could possibly be wrong? for (int i = 0; i < d; i++...
1
vote
2answers
99 views

The Case of the Disappearing Tiles

I just finished trying to implement my move function. It seems to work to a certain extent, except that some of the tiles keep turning into blanks. I have the following code for my swapping: for (int ...
1
vote
2answers
26k views

How do I fix a “use of undeclared identifier” compilation error?

In the following code snippet: for (int column = 0; column < d - 1; column++); { board[&row][&column] == counter; counter++; make returns the following error: fifteen.c:140:19: ...
0
votes
5answers
406 views

Errors Running mario

A few days ago, this program ran correctly, but now it's showing errors. I tried to find the problem, but I don't understand what these error message mean. What am I doing wrong? jharvard@appliance (~...
1
vote
1answer
3k views

What do these Check50 errors mean?

I get many compilation errors when I compile greedy.c. However, my mario.c and greedy.c programs with 2 and 3 residual appear to pass check50 tests! jharvard@appliance (~/Dropbox/pset1): check50 ...
1
vote
1answer
254 views

Submisson of psets using the CS50 submit facility

I was having a problem with error 403 when trying to use CS50 Submit. Rob Bowden suggested: Unfortunately there isn't currently an alternative way of submitting. On that 403 page that you see, if ...
0
votes
1answer
252 views

My sort and search functions don't work for find.c - look at my code?

I try inputting ./find 31 and then the list 30, 31, 32 and it still says it can't find the needle in the haystack. :( I don't know if it's my search function, my sort function, or both. Help! The ...
1
vote
1answer
3k views

How to Fix “control may reach end of non-void function” and “No such file or directory” Errors?

When I compile find, I get this error message error: control may reach end of non-void function When I then try to run the program ./find 14 I get this error message bash: ./find: No such file ...
1
vote
1answer
839 views

How to test helpers.c

I'm just wondering the best way to test out sort and search in helpers.c. Since the file won't compile/run on its own, how can I test the code that I'm writing?
4
votes
2answers
1k views

How to use current timestamp or now()

In CS50 pset 7, there is a part where you have to use SQL to insert the date and time of a transaction into a table. According to the web, there is a function to do that called CURRENT_TIMESTAMP or ...
2
votes
1answer
1k views

Hacker2, Crack: Optimisations

I'm busy with the crack program for the hacker 2 assignment. I wrote a dictionary attack which works well for some of the passwords. I also wrote a brute force attack for the other passwords that the ...
0
votes
1answer
108 views

Dereferencing 2d pointer to print board

I've used pointers to help create my game of fifteen grid, and now I want to print out the board using 'draw'. The function works to the point that the board prints, but instead of array elements I ...
0
votes
2answers
300 views

Can't run CS50 version 19 using VMWare Player - The file is too large

I have installed VMware Player on my Windows 7 machine and when trying to run the CS50 appliance 19 I get the following error: VMware Player cannot open one of the virtual disks needed by this VM ...
0
votes
1answer
195 views

marker position

I am working on pset8, and I am trying to implement pickup(). I have to find out if any of the passengers in PASSENGERS are closer than fifteen meters away. I currently have this if statement: if (...
0
votes
1answer
452 views

How do I check to see if programs are submitted?

I submitted my programs online for psets 1 and 2 and I cannot see any indication of it being graded or corrected. Is it possible to see if they are correct? This is through the cs50x submit page.
1
vote
3answers
4k views

Torrent for all the lectures?

I see links to torrent downloads for all the individual lectures - is there a torrent of all the lectures in one file available?
0
votes
1answer
143 views

What is wrong in this implementation of hash table?

The following implementation for insert() function that inserts input into a hash table namely first each of which elements are pointers to a linked list works well. // takes the number to be ...
4
votes
2answers
7k views

Why use fgetc instead of fscanf?

In pset6 specification, in question 5, we have been asked why fgetc has been used instead of fscanf. And i don't understand the benefit of using fgetc. So please explain this. Also, in pset 6 ...
0
votes
1answer
137 views

Compilation Errors When Compiling greedy

For some reason, even though I have declared the float variable change in my greedy.c program, the Clang compiler gives an error message saying that I have not declared it. Even with 3 compiler ...
1
vote
1answer
506 views

Awkward behaviour of GetInt()

So i am working on a linked list program and am using functions like insert, delete and search which require taking input from the user and so i tried using GetInt() from the CS50 library for the same ...

15 30 50 per page
1
228 229
230
231 232
235