Questions tagged [week4]

The tag has no usage guidance.

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

Cs50 Sepia properly coded

I did the sepia filter for the cs50 week 4 problem "filter) and although it works, I've been wondering, is there is not a more "proper" way to write the code, that is with out repeating ...
0
votes
1answer
15 views

Pset4: Recovery- Empty JPEG files

My code compiles fine and the syntax seems fine, but the 50 JPEG files it produces are all empty, except 001.jpg and 019.jpg which both show a small top portion of the image. Could someone kindly tell ...
0
votes
1answer
41 views

CS50 Week 4 Recover. Generating 50 Blank images

Here is the code any help is greatly appreciated. Thanks! #include <stdio.h> #include <stdlib.h> #include <cs50.h> #include <stdint.h> #include <stdbool.h> typedef ...
0
votes
0answers
24 views

CS50 filter less Blur problem

I've wrote the code for filter Blur that seems to me have to work. But i don't receive right numbers. Please help me :))) void blur(int height, int width, RGBTRIPLE image[height][width]) { for (int i ...
0
votes
1answer
45 views

CS50 Recover jpg files not found

I've been stuck on Recover for the last few days. I'm trying to work out why Submit tells me none of the jpg files are found. I've revised it multiple times, worked it out on paper... I can't figure ...
0
votes
1answer
13 views

Querry regarding maintainence and usage of files in c

So, csv files are used to store data and so does .txt files. I just want to know how do we manage a large text file. For example, if i have a file which contains all the info about school students, ...
0
votes
1answer
11 views

writting a function to display a file

in the week 4 shorts, it was told how we can write cat command from linux in c: i Wrote the following code: #include <stdio.h> include void Print_File(FILE *f) { char s = fgetc(f); while (s ...
0
votes
1answer
76 views

Week 4 GrayScale - Calling a function called Average within Grayscale

So I understand that the grayscale part of the assignment is supposed to be pretty basic, however, I am running into some unusual issues here. The following is my code for the grayscale filter. //...
0
votes
0answers
21 views

Pointers - Week 4 Lecture

I am having a hard time understanding the following sets of code. In the lecture, the professor alluded to how char * represents an address to a character. Additionally, he mentioned that in order for ...
0
votes
1answer
378 views

SEGMENTATION FAULT : Week 4- shorts-Recursion - Collatz conjecture

I can't understand why my program is facing a segmentation fault. I decided to make my own program which counts the number of steps used in Collatz Conjecture(as discussed in week 4). The picture ...
0
votes
1answer
40 views

WEEK4 Pointer examples does not work, i really need explanation

am trying any example from here https://www.tutorialspoint.com/cprogramming/c_pointers.htm and they compile and work in codeblock but in cs50 ide its always: #include <stdio.h> int main () { ...
1
vote
1answer
1k views

strcmp always returns 0, even with different strings. Week4

Working through the CS50 pages, I decided to do this locally on my Linux Mint computer (gcc --version gets me: gcc (Ubuntu 4.8.4-2ubuntu1~14.04.3) 4.8.4). At the start, I did not realize that cs50.c ...
0
votes
1answer
247 views

Check50 doesn't accept my resize solution

My resize program seems to be working fine on both bitmaps that require padding, and bitmaps that don't. I've compared the results with the staff's solution both visually and using peek, but ...
0
votes
1answer
22 views

This code is written as per video in CS50 week 4 but it is not working

I have written this program as described in Walkthrough week 4 in structs 0 but it is not working, Kindly point out the mistake Thanks a lot. # include <stdio.h> # include <cs50.h> # ...
0
votes
1answer
37 views

Trouble with padding in resize

My code for resize works unless the file I'm resizing requires padding. For the life of me I can't figure out what I'm doing wrong. I've been messing around in gdb for hours. Help and explanations ...
0
votes
3answers
124 views

Week 4, Section : Dynamic Memory Allocation

After watching Dynamic Memory allocation section and reading this i am a bit confused, if declaring an array int array[10]; and allocating using malloc int* parray = malloc(10 * sizeof(int));...
0
votes
0answers
28 views

Week 4 walkthrough: bounce.c (and other)

I would be grateful for the help on how to write and run such programs as bounce.c on Mac OS 10.7.5. I am using Appliance only partially, and have done all previous pests in Xcode, and used a ...
1
vote
1answer
21 views

Walkthrough 'text' why is pressing enter needed

Why in the walkthrough titled 'text', does the text in the text field only get transmitted to the Gedit window when Enter is pressed. At which point in the code does it state 'When Enter is pressed ...
0
votes
1answer
23 views

Regarding week4's lecture video

l have just seen the week4's lecture video where it has been cleared out that string is actually char* under the hood! Then, I encountered and example where why he tries to copy a string by assigning ...
0
votes
1answer
53 views

For week 4 walkthrough unused variable even though I typed the same code as David

I type the same code as David, yet I get an unused window error and he doesn't. My code follows, and you can just as easily compare with his. #include <spl/gevents.h> #include <spl/gwindow....
2
votes
0answers
56 views

Why am I getting linking errors when trying to make a program that uses the SPL? [duplicate]

Why is it, whenever he uses "make" to generate the program, it works flawlessly; but when I do the same, I always receive linking errors? make text clang -ggdb3 -O0 -std=c99 -Wall -Werror text.c -...
1
vote
0answers
153 views

week4 some compiling error

jharvard@appliance (~/Dropbox/pset3): make ./bounce clang -ggdb3 -O0 -std=c99 -Wall -Werror bounce.c -lcs50 -l`enter preformatted text here`m -o bounce /usr/bin/ld: /usr/lib/debug/usr/lib/i386-...
0
votes
0answers
282 views

week 4 | walkthroughs | button | compiler error “use of undeclared identifier 'GButton'”

make button » error: use of undeclared identifier 'GButton' jharvard@appliance (~/Dropbox/pset3): make button clang -ggdb3 -O0 -std=c99 -Wall -Werror button.c -lcs50 -lm -o button button.c:12:5: ...
0
votes
2answers
126 views

Understanding the differences between the recursion examples from the week 4 lecture 1

When David was taking about these two codes: int sigma(int m) { if (m <= 0) return 0; else return (m + sigma(m - 1)); } and int sigma(int m) { return (m + sigma(m - 1)); } I ...