Questions tagged [week1]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
1 answer
22 views

Cant get Codespace to work

Im up to the "Hello" module, week 1. Ive never programmed before so setting up copespace has been quite frustrating. I cannot get it to work. Can someone please help me? I want to get ...
user avatar
0 votes
1 answer
13 views

week 1 no workspace?

I'm trying to get through the first 15minute of the lecture and already lost :( I tried to go through other questions that recommends to find the right ~workspace and ~pset1 but I don't know how to go ...
user avatar
0 votes
1 answer
67 views

problem with credit with this numbers (369421438430814 & 5673598276138003)

I just finished solving the credit problem and regularly used check50 to see my results, and then this happened. check50 sees that these numbers : 369421438430814 5673598276138003 are invalid, even ...
user avatar
0 votes
0 answers
32 views

Week 1 Lab, population, in the area of the calculation of years required to reach threshold i need any help please

#include <cs50.h> #include <stdio.h> int main(void) { int counter = 0; int popinc; int e; // TODO: Prompt for start size int s; do { s = get_int("Start pop: ")...
user avatar
0 votes
1 answer
102 views

I don't understand the comments from check50 on my lab 1 submission. could anyone help please?

This is my code #include <cs50.h> #include <stdio.h> int main(void) { // TODO: Prompt for start size int s; do { s= get_int("Start size: "); } ...
user avatar
0 votes
1 answer
12 views

No such directory - Week 1

I am unsure why my mario.c and mario are not showing up as directories? I am sure this is a very simple fix. However, I seem to be at a loss of what to do! I would appreciate any feedback! Thank you!!
user avatar
0 votes
1 answer
53 views

Why do I get this "expected expression" error?

Like mentioned in the title, I get this "expected expression" error when I try to convert my amount from float into int type. Am I doing the conversion wrong ? Or is there something else I'm ...
user avatar
  • 5
0 votes
1 answer
29 views

Week 1 Credit; Not Creating Variable

I'm starting the week 1 credit problem, however, when trying to set together every second digit it simply does not print. Could you help me identify where I went wrong? Thanks! #include <stdio.h>...
user avatar
  • 5
0 votes
2 answers
328 views

how do i write pesudocode.txt for Mario? (less comfortable)

After I input: mkdir ~/pset1/mario its asking me to write pseudocode.txt and i am not sure how i can do that. I've tried inputting the pseudocode.txt and that gives me "command not found"
user avatar
0 votes
2 answers
30 views

Else If Boolean Statements of Equality In the Case of Complex Numbers

In the lecture for Week 1, Professor Malan said that in an if statement, the third boolean expression (else if (x ==y)) is redundant or implied, since logically, if it is false that a number is ...
user avatar
1 vote
1 answer
65 views

Cant get past the ls command in hello.c

I cant get past the List command in hello.c, and i'm not sure if i'm supposed to get something in the terminal after i type in ls, so i kept going and typed clang and i get the error message. I've ...
user avatar
0 votes
1 answer
54 views

Prompt a user for a number. My code has an endless loop

i am trying to build a code in which the user should input a number between 1-5. In any other case the program should request the user to input a new number. My problem is that the program is going ...
user avatar
0 votes
1 answer
128 views

Credit.c works, but not completely?

So I finished credit.c today and was trying out different numbers from the paypal website the course provided and got some unexpected results and don't know what to do with it. When I type in valid ...
user avatar
  • 107
0 votes
1 answer
449 views

Can't use get_long_long();

So somehow I cant use the get_long_long(); function. It lets me declare the variable, but I cant get any user input for it. Here's my code: #include <stdio.h> #include <cs50.h> #include &...
user avatar
  • 107
0 votes
1 answer
42 views

Transform function into a loop or similar

So my problem is in problem set 1 of week 1 of the CS50 Harvard course. The task was writing a program that calculates the smallest amount of coins possible when getting change. I've already written ...
user avatar
  • 107
0 votes
1 answer
189 views

Week 1 cash.c assignment: How can I get a variable to mutate as it gets operated on?

the way my code works is to reduce c as we count out coin-types. But I'm getting errors. #include <cs50.h> #include <stdio.h> int main(void) { float c; do { ...
user avatar
0 votes
1 answer
380 views

get_int variable in mario causing errors

Hi I'm getting an error that says "x" is an unused variable. And I'm also getting errors every time I try to use "x". I have reviewed David's get_int example from Lecture 1: int main(void) { ...
user avatar
0 votes
3 answers
3k views

Week 1: get_int & get_string errors

Fro the files int.c and string.c, I copied the code from the lecture exactly, and was receiving errors, then modified the code according to suggestions online by adding #include <cs50.h>and I'm ...
user avatar
  • 19
0 votes
1 answer
603 views

Switch(c) undeclared identifier

I am trying to compile the example codes from the shorts with Doug Lloyd. I was putting together the switch.c example, and there seems to be a problem with the c of switch (c). Here is what I have. ...
user avatar
0 votes
1 answer
55 views

Can't compile adder from week 1

im trying to compile my program but a problem keeps popping up and i cant seem to understand why. Here's the program and the problem.
user avatar
3 votes
1 answer
808 views

Week 1 compiling String.c using clang instead of make

in week 1 as I understood : make= compile the file and name the compiled file with the same name. clang= compile the file with the default name. when I've used make it worked and when I used clang it ...
user avatar
-1 votes
2 answers
67 views

Week 1 : After using the cp command and copying the file, the duplicate file does not run and prompt appears saying "Nothing can be done"

Week 1 : After copying a file, can a duplicate file be compiled and run?
user avatar
  • 1
0 votes
2 answers
68 views

Can we use math.h and strings.h for credit.c

I can only think of ways to do credit.h using functions from string.h and math.h, but they're not covered in the week's lecture. Are we allowed to use them?
user avatar
0 votes
1 answer
384 views

the inbuilt cs50's library functions not working

For god sake this one isn't working. Can anybody help? Thanks in advance #include <stdio.h> #include <cs50.h> int main(void) { string s = get_string(); printf("Hello, %s\n", s); }...
user avatar
  • 3
0 votes
1 answer
103 views

week 1 string.c errors

I am going through week 1, and once I enter this: #include <cs50.h> #include <stdio.h> int main(void) { string name = get_string(); ...
user avatar
  • 11
0 votes
1 answer
512 views

CS50 PSET 1 Hacker Bad Credit Code

The goal is to find if a credit card number is valid. Complete Instructions Here: https://cdn.cs50.net/2015/x/psets/1/hacker1/hacker1.html#bad_credit Can I please know what makes my code fail? (I ...
user avatar
0 votes
2 answers
25 views

Not a problem set, but a question about the "sizeof" example from week 1 walkthroughs

I've been trying to follow along with all the examples in the walkthrough and there's something that I can't get to work and I can't for the life of me figure out WHY I keep getting this error message....
user avatar
0 votes
1 answer
52 views

Last program from the first half of the lecture in week one?

I tried to run the last program from the first lecture video of week 1, and I got this error: clang -ggdb3 -O0 -std=c11 -Wall -Werror pain.c -lcs50 -lm -o pain pain.c:61:1: error: type specifier ...
user avatar
  • 130
0 votes
1 answer
42 views

Why does PrintName return void?

Okay so in the PrintName function, it contains a printf function. However, I read that printf returns a value which is the number of characters. Shouldn't PrintName hence return an int as well? Thanks!...
user avatar
-1 votes
1 answer
159 views

How to fix the "nothing to make" error? [duplicate]

I just made a new file called mickey.c (basically a version of hello.c). I went into the directory and executed the command make mickey.c it says "nothing to make". here is the output from terminal:...
user avatar
0 votes
1 answer
56 views

Trying to change directory in week1 example hello1.c

I am trying to change directory in week1 tutorial example hello1.c, but its showing an error message bash: cd: dropbox: No such file or directory
user avatar
  • 1
0 votes
1 answer
40 views

why is no "\n" needed after GetString?

Watching the first week 1 lecture, they went over how you need "\n" to print a new line. However in the example: { printf("Your name please: "); string s = GetString(); printf("hello, %s\...
user avatar
0 votes
1 answer
1k views

How should I take notes for the lectures?

learners! I'm glad to be a part of this community. About our course, CS50, I was frustrated because in our university we didn't learn how we could take notes from the course. Our instructors start ...
user avatar
0 votes
1 answer
74 views

CS50 Appliance compiling error!

Just started cs50 on edx a week ago. Just finishing the walkthroughs for Week 1. In the walkthroughs, there is a one video about "Switch" and "Cases". Ive written the code correctly, I think, but ...
user avatar
0 votes
2 answers
328 views

Week 1 - Conditions - error expression result unused (expect ; at end of if else)

Error: expected expression (see photo) It's a very basic program and I'm sure I've made a simple syntax error. There shouldn't be a ";" at the end of the else line and I have included the ; at the ...
user avatar
0 votes
1 answer
53 views

week 1 get 4 errors when compiling hello-1

I keep getting the following 4 errors when I try to make hello-1
user avatar
0 votes
1 answer
303 views

The compiler Clang isn't showing

The compiler Clang isn't showing and I'm at a complete lost of why it isn't. Please help me. bash: clang: command not found cs50
user avatar
  • 1
0 votes
0 answers
56 views

Why is -ls stdio.h not used?

During the Week 1 lecture continued at approximately 31 mins in the instructor talks about telling clang to link cs50 into his program. I was wondering why you don't need to tell clang to link in to ...
user avatar
0 votes
1 answer
756 views

Permission Denied in pset1

I am stuck in week 1 lectures. Initially after watching the videos I was able to run the codes, 'make hello' and './hello.c', then after an update to the CS50 appliance the codes wouldn't run any ...
user avatar
0 votes
1 answer
40 views

Where can I download "src1m" folder of files used in week 1 lecture?

I want to download and run the files David used in the week 1 lecture, the folder's titled 'src1m'.
user avatar
1 vote
1 answer
2k views

Why do I not have to link stdio.h while compiling with clang?

To compile this source code with clang, we had to link "cs50" library like this: clang hello.c -lcs50 but we did not have to link "stdio". why? /* hello.c */ #include <stdio.h> #include <...
user avatar
0 votes
2 answers
401 views

CS50 commands, standard commands - is there any literature and who did that? [closed]

I am on week 1 and it is a lot frustrating to me. I certainly am not good with computers. When in first part of the lecture, teacher says things such as someone invented it, computer looks for it... I ...
user avatar
0 votes
2 answers
976 views

Do we need to return 0 in C?

I found a lot of C tutorials on the internet ending their main functions with return 0;, but I don't see David doing that. Can anyone explain to me please? I've only finished watching Week 1 lectures ...
user avatar
0 votes
0 answers
46 views

Pset0 isn't under Week 0 but, Week 1. Bug? [duplicate]

The Problem Set 0 which was previously under Week 0 is now displaying under Week 1. Week 0 does not display any Problem Set, and the Problem Set of Week 1 shows under Week 2? Is this some kind of bug ...
user avatar
  • 1
0 votes
1 answer
52 views

Trying to compile f2c.c from walkthrough week1 without success [duplicate]

I'm trying to compile the programming from the walkthrough week1 f2c but it doesn't work. I don't know what I'm doing wrong. When I type in "make f2c" it returns *** No rule to make target `f2c'. ...
user avatar
1 vote
1 answer
281 views

Where is the CS50 style guide document?

In his short on C style in week 1, Tommy refers to a style guide. I can't find it. Where is it? I have already looked through the cs50 site and can't find such a document there.
user avatar
0 votes
1 answer
1k views

hello.c when I want to run it says:No such file or directory

I am currently watching lecture one in week 1 and have the problem with hello world example professor Malan explained.I do everything by the instructions,save it in Dropbox folder as hello.c.In ...
user avatar
-1 votes
1 answer
56 views

Is there a mistake in the slides of Section 1?

I am reading the slides for the Section 1 (2014) which I downloaded from here. (I cannot view the video because of less bandwidth). I am on this page (28): The condition given in the code is that we ...
user avatar
  • 111
4 votes
2 answers
186 views

What is the difference between ++i and i++?

After watching Precedence in the Week 1 Shorts, I know what i++ means, but I still don't understand: What is the difference is between i++ and ++i?
user avatar
  • 157