Questions tagged [pset4]

The standard edition of Problem Set 4 will move beyond C programming language basics, testing your knowledge of pointers, memory management, file i/o and structs.

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

Incorrect blur for filtermore

for this problem, I have opted to use a strategy where I create a 1 pixel border in a copy image with RBG values = 0, to avoid running into segmentation errors when trying to access a pixel. I also ...
Kik's user avatar
  • 1
0 votes
1 answer
21 views

filter-less blur function

I am stuck at pset4 filer-less, blur function. The duck and chatgpt say that my code is correct but it doesn't give excepted outputs in any of Check50 result for blur function. //Blur image void blur(...
Arman Chauhan's user avatar
0 votes
0 answers
49 views

Little Professor check50 shows error even though program run completely fine

I'm facing an annoying issue while trying to validate my Little Professor results. I've ran the program several times and it does run as per the specs however when running the check50 it keeps on ...
Gilardino's user avatar
0 votes
2 answers
35 views

pset4 blur; artifacts on a white parts of an image

I believe I've done this part of filter-more task pretty well, but, unfortunately, an output image has some artifacts - blur works badly with white parts of an image. void blur(int height, int width, ...
REJEN RJ's user avatar
0 votes
1 answer
32 views

Pset4- recover: recovered jpgs appear to be empty

I tried to implement recover through the simplest and shortest way I could imagine. The code compiles and saves 50 JPGs with proper names, but when I open them, all of them are just empty and even ls -...
Fawz's user avatar
  • 1
0 votes
1 answer
31 views

Recover PSET 4 Week 4 - skipping while loop

This is a follow up to my previous question. After I went through my code on debug50 it shows that my while on line 35 is not going through. I checked my code with other others on this site and they ...
Raheel A's user avatar
0 votes
0 answers
29 views

bitcoin excersise problem set 4

the code works in my pc but check50 find this error and I don't understand why: Traceback (most recent call last): File "/tmp/tmptndsrole/test_two_coins/testing.py", line 28, in bitcoin....
domionico's user avatar
-1 votes
1 answer
33 views

CS50 PSET 4 Recover - segmentation fault and blank file

I have been trying to solve this question for a while now but I am still not sure what is wrong. The program works fine before the while loop but after it stops working and when checking with check50 ...
Raheel A's user avatar
0 votes
1 answer
34 views

CS50 Recover Problem: Why does it give Segmentation fault (core dumped)

I have looked all over to see other people with issues with segmentation default on this problem. I don't see that i have the same issue and i am not sure what i did wrong // Ensure proper command ...
king342's user avatar
0 votes
1 answer
99 views

Why am I failing check50, Cs50p Little Professor

I get this reply after executing check50: :) professor.py exists :( Little Professor rejects level of 0 expected program to reject input, but it did not :( Little Professor rejects level of 4 ...
Mikail Kuehl's user avatar
-1 votes
1 answer
31 views

Pset 4 Filter (More) -- PLZ HELP

When I declare the array earlier, I end up with the wrong output. But when I declare it inside the loop, the final output is correct. Plz tell me how to explain this. The wrong one: void edges(int ...
xyj's user avatar
  • 1
-1 votes
1 answer
47 views

CS50 Pset 4 edges: Why do I keep getting segmentation fault?

Please help me figure out what's wrong! I've been doing this pset for so long now, and I feel like everthing should work, But I just get a seg fault! The code looks like... void edges(int height, int ...
Harr's user avatar
  • 35
0 votes
0 answers
6 views

I have an issue with my code in Pset4 Recover: It compiles right and makes all 50 needed images, yet there's no data seemingly in any of the images

#include <stdint.h> #include <stdio.h> #include <stdlib.h> // Defining a datatype for BYTEs typedef uint8_t BYTE; int main(int argc, char *argv[]) { if (argc != 2) { printf("...
Kasra's user avatar
  • 1
0 votes
0 answers
27 views

CS50 PSET4 Recover. Files created, images visible, why check50 fail?

Why isn't check50 clearing even though the files are created and the images are visible? #include <stdint.h> #include <stdio.h> #include <stdlib.h> typedef uint8_t BYTE; typedef ...
Don Tan's user avatar
-1 votes
1 answer
34 views

pset4 reverse confusion

Just checking, are we supposed to write each block we fread() from the input with each element in the same order as we read them from the input file, or are we supposed to write them with each element ...
Joseph J Filoramo's user avatar
0 votes
1 answer
64 views

program is free of memory errors

Im about to finish pset4, currently on recover! Everything is ok at the first look, program compiles, however, there is a problem when I run check50. As you can see from the title, something is off ...
liza's user avatar
  • 13
0 votes
0 answers
21 views

pset4 filter/more edge

My code compiles and run okay I does everything but when checking with check50 It shows error My code is : #include "helpers.h" #include <math.h> // Make a copy of array void ...
Rex Kartik's user avatar
0 votes
2 answers
46 views

CS50 pset4 filters/less check50 error

I am trying to check my code using check50 but it gives me the error But when I am compiling it and running it from the terminal it runs just fine. My code for helper.c is #include "helpers....
Rex Kartik's user avatar
0 votes
0 answers
9 views

Pset 04 Edges FIlter. I don't know whats wrong with the code

I've been trying to implement the function edges with an auxiliary one, determineEdges. It compiles, but generates, probably by an error, a black image. I'm having trouble to figure out what is the ...
Alex's user avatar
  • 1
0 votes
0 answers
21 views

program in recover pset4, please help me find the errors and if you could add how to debug the code, its will be helpful

#include <stdio.h> #include <stdlib.h> #include <stdint.h> typedef uint8_t BYTE; int main(int argc, char *argv[]) { if (argc != 2) { printf("./usage: recover filename\n"); ...
Trex Vanga's user avatar
0 votes
1 answer
19 views

Problem with Edges Pset4

I've been at this Pset for a while now, I've got everything down except for Edges, and if I'm understanding correctly, every single value is coming out correctly except for the values for blue are 99% ...
Mohamed Amr's user avatar
0 votes
1 answer
14 views

Pset 4 Filter - The Blur filter. I only pass the "Blur correctly filters pixel in corner" though I can see that the output is entirely filtered

Here is my code.. It seems to work fine. I just can't tell why can't I pass the stupid checker! Hope someone can assist me. void blur(int height, int width, RGBTRIPLE image[height][width]) { ...
Mostafa Abdelnaser's user avatar
0 votes
0 answers
23 views

Recover, Produces 50 JPGS but doesn't pass check50 and the memory leak check is neutral (can't check)

#include <stdio.h> #include <stdlib.h> #include <string.h> int check(); int main(int argc, char *argv[]) { int name = 0; FILE *fptr = NULL; char filename[8]= {0}; int x = 0; int i = ...
Mohamed Khedr's user avatar
0 votes
0 answers
7 views

Having issues with PS4 Filter (Less) Blur Function

I feel like I'm really close to a solution to this problem, I just can't put my finger on where the issue is occurring any tips would be greatly appreciated. void blur(int height, int width, RGBTRIPLE ...
Daniel Thane's user avatar
0 votes
1 answer
19 views

Can someone please help me in resolving this issue. I don't quite understand what I am supposed to change here

Ok, so apparently there are no compilation errors. But what exactly is happening here. Like, why am I getting this error? P.S-Even help50 doesn't seem to be of much help here... The actual code is as ...
Soham Roy's user avatar
0 votes
1 answer
12 views

Iterating over the members of RGBTRIPLE struct

The RGBTRIPLE data type specified in bmp.h has three members, and I want to be able to iterate over them like: for (int k = 0; k < 3; k++) { printf("%i\n", image[i][j][k]) // prints ...
pherb's user avatar
  • 1
0 votes
0 answers
6 views

No error when image array out of index

I wrote some code for reversing the image, and was finding one of the columns wasn't moving - realised I was indexing image[i][width] element, which didn't exist due to 0-indexing. However it didn't ...
pherb's user avatar
  • 1
0 votes
1 answer
47 views

my 'reverse' code works on wav files but it doesn't pass check50

#include <stdint.h> #include <stdio.h> #include <stdlib.h> #include "wav.h" int check_format(WAVHEADER header); int get_block_size(WAVHEADER header); int main(int argc, ...
ME Desings's user avatar
0 votes
1 answer
54 views

in pset4, recover, why is the first jpg found treated differently from the other jpg files?

I'm starting to work on pset4, recover, and (as you can tell) things are not going well. I read posts from other students working on the same problem and realize some of them check for the jpg header ...
Alvaro Barboza's user avatar
0 votes
1 answer
26 views

pset 4: recover only recovers grey and black squares

I am unsure on why my code is only recovering black and grey squares, instead of images. I have tried closing the file img in multiple places, and I still can't seem to solve the problem, I believe it ...
Robbie's user avatar
  • 5
0 votes
1 answer
106 views

cs50p pset4 bitcoin

According to the presentation of week 4, we can access to the dictionary element with the following expression: o = response.json() for result in o["results"]: print(result["trackName&...
Victor Araya's user avatar
0 votes
0 answers
28 views

Week 4 - Filter (More Comfortable) - Edge

I cannot for the life of me understand what's wrong here. It does apply a filter, but it looks too blue and doesn't pass the CS50 check. Any ideas? void edges(int height, int width, RGBTRIPLE image[...
Nico Tordini's user avatar
0 votes
1 answer
36 views

PSET4 Recover Successfully Generates Images But Does Not Match Correctly

Currently on PSET4 Recover. My code manages to generate 50 images which can be opened, however check50 states the images do not match correctly. Would anyone be able to offer some advice? #include <...
chonker's user avatar
0 votes
0 answers
11 views

Reversing an audio file

I having been working on an audio file to reverse its contents but don't know why my code isn't working, kindly check: BYTE audiodata[blocksize]; // blocksize is 4 in my case int pointer = 1; // file ...
RamshaHashmi's user avatar
1 vote
1 answer
15 views

PSet 4 - Recover. The first picture (000.jpg) doesn't get recovered, all other images do (049.jpg is the last image recovered)

Everything else works in my code, no memory leaks, all other images are loaded properly, except the first one. I've gone through debug50 to try and see the problem, but I can't seem to find one since ...
They think im slow EH's user avatar
0 votes
1 answer
36 views

pset4 recover segmentation fault (core dumped)

I am getting segmentation fault and i was searching on the internet, comparing with other codes, reading this forum, etc. and i still can not fix mine. Explaining my code from the while: read the ...
Victor Araya's user avatar
0 votes
1 answer
26 views

Pset4 Recover getting segmentation fault but I have no idea why

This is the answer I have come up with for pset 4 recover: #include <stdio.h> #include <stdlib.h> #include <stdint.h> int main(int argc, char *argv[]) { // Ensure proper usage ...
dbergkamp5's user avatar
0 votes
1 answer
34 views

What is wrong in my TODO 8? PSET04 - RECOVER

I'm Currently doing the PSET04 Recover. I've done all the TODOS, but in the last one, I think I have an error and I don't know why. Check50 prompts me everything is ok except for the last requirement. ...
AlvaroAndLukeTheCoder's user avatar
0 votes
1 answer
42 views

Why does the 0.49 jpg file doesn't match correctly?

I'm doint the recover PSET04. I think, I've done everything correct expect of the 0.49 jpg file. It says that it doesn't match correctly. And the last error in Check50 is "can't check until a ...
AlvaroAndLukeTheCoder's user avatar
0 votes
0 answers
12 views

PSET04-filter more Edge Function. I need help, PLEASE!

I'm very confused why my code is not working. And there are these strange errors in the results of Check50, I don't know why. I know it could be complicated to read my code due to the amount of code I ...
AlvaroAndLukeTheCoder's user avatar
0 votes
1 answer
12 views

CS50 PSET 4 memory error on check50 but not on valgrind -s

I have no idea where to close the outptr. My code CS50 generates the following memory error on check50 but no error on valgrind -s running valgrind --show-leak-kinds=all --xml=yes --xml-file=/tmp/...
Jelmer den Hertog's user avatar
0 votes
0 answers
33 views

PSET4 filter-less: black screen when running blur function

I am currently working on the blur function, in filter-less. I am greeted woth a black screen when I run the function, and I'm unsure what part of my code is causing this to happen. Here is my code as ...
Robbie's user avatar
  • 5
0 votes
0 answers
16 views

Can't figure out what is wrong with my blur code

void blur(int height, int width, RGBTRIPLE image[height][width]) { // DEFINE ONE STRUCT TO ACT AS BUFFER MEANWHILE CALCULATING AVERAGE RGBTRIPLE buffer[height][width]; // GO THROUGH EACH ...
Krakard's user avatar
0 votes
1 answer
127 views

reverse .wav file not working correctly

I tried running this code to reverse the .wav audio file, but it does not work as required. Can someone explain what's wrong? // create array of size (size) to store blocks BYTE buffer[size]; // ...
Ahmed ElToukhy's user avatar
0 votes
0 answers
79 views

Professor Code Rejected by CS50 Check50

When submitting the code to check50, I get the following error message: ":( Little Professor accepts valid level Cause: Timed out while waiting for program to exit." When I run the program ...
RedHorseMane's user avatar
0 votes
1 answer
26 views

Problem set 4 recover producing only one image, that too is corrupted

here is my code: #include <stdint.h> #include <stdio.h> #include <stdlib.h> #include <string.h> const int BLOCK_SIZE = 512; int main(int argc, char *argv[]) { // ensure ...
Martund's user avatar
  • 101
0 votes
0 answers
17 views

Segmentation error in Recover Pset - any clues? A bit stumped

#include <stdlib.h> #include <string.h> #include <unistd.h> #include "check_arguments.h" #include "jpeg_file_structs_and_operations.h" #include <stdio.h> ...
BaaBaa's user avatar
  • 1
0 votes
1 answer
18 views

PSET4 Recover - Why do I get Segmentation Error from Check50

my recover program compiles fine. When I run the program, I do not get any errors. When I look at the 50 outfiles, I can see the pictures with the image preview. Valgrind indicates that there are no ...
Zach's user avatar
  • 1
0 votes
1 answer
29 views

P4 Recovers only first 512 bytes

im really struggling with this one and your help would be really appreciated My code is working quite good but theres a error with writing file wich i cannot fix // i will start with line where i ...
Marek Pecnik's user avatar
0 votes
0 answers
215 views

i having trouble with todo 8 in pset4 reverse

#include <stdint.h> #include <stdio.h> #include <stdlib.h> #include "wav.h" int check_format(WAVHEADER header); int get_block_size(WAVHEADER header); int main(int argc, ...
hoang15nguyen's user avatar

1
2 3 4 5
37