Skip to main content

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.

356 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
2 votes
1 answer
194 views

Header Problem in Resize

There is some serious flaw in the header file code of my program since all the variables that was required to be modified is showing error while running the peek program (as shown in in the screenshot ...
ABor's user avatar
  • 55
1 vote
1 answer
120 views

Pset4 Filter (Less) - Invalid operands to binary expression (Int and RGBTRIPLE)

Hello. I'm facing a problem trying to compile this code. I got the error msg Invalid operands to binary expression ('int' and 'RGBTRIPLE') void blur (int height, int width, RGBTRIPLE image[height][...
Min Wai's user avatar
  • 11
1 vote
2 answers
110 views

Cleaning up PSET4 Blur

I have successfully finished the blur effect on PSET4. Here is a small smattering of the code if(i - 1 >= 0 && j - 1 >= 0) { red += OgImage[i-1][j-1]....
Multiplify's user avatar
1 vote
1 answer
381 views

PSET4 — Filter (more) — Edges Error

I'm currently working through the filter problem, and I'm not sure why it's not working on the pixels on the edge (it also seems to only be incorrect on the B value in RGB). This is the message I'm ...
Seamus McGill's user avatar
1 vote
2 answers
81 views

Blur only working with middle pixel

I've been stuck in this problem for a while, and the code only works when its inputted a middle pixel. Does anyone have a clue? I've searched everywhere for this particular issue, but I have only ...
fer 545's user avatar
  • 11
1 vote
1 answer
43 views

Pset4 - Filter (more) Edge Detection Help

I'm testing my Gy function separately, and it looks like the values I put in the test array are not correctly showing up in the function. I printf() the main function and they are recording correctly, ...
Rachel Pospíšil's user avatar
1 vote
1 answer
503 views

Week 4: Recover (invalid stdio handle)

As I'm sure you're aware, the goal of this assignment is to recover a number of deleted jpeg files from a provided memory card image. My code compiles and executes, but I'm receiving the error "...
Aaron Shotwell's user avatar
1 vote
1 answer
404 views

pset 4 filter edge not working

I am having issues with my implementation of edges. I decided to make a 'border' around the edges of the image made up of zeros (did this in a copyImage array). I get correct outputs for some of the ...
DP12345's user avatar
  • 111
1 vote
1 answer
469 views

Looking for clarification on PSET4 Resize - "Rewrite" method

Can I request for some help on my resize.c pset? I'm trying to do the "rewrite" method as per the pset's walkthrough. The pseudocode is as follows: 1 for each row 2 for each pixel 3 write ...
clearh's user avatar
  • 11
1 vote
1 answer
152 views

pset 4 - recover -> invalid pointer

i am trying to solve the recover issue. When I run my programm I get: * Error in `./recover': free(): invalid pointer: 0x0000000001da5200 * Aborted I don't know how to proceed. Can someone please ...
Skywalker's user avatar
1 vote
1 answer
3k 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 ...
number9's user avatar
  • 111
1 vote
0 answers
58 views

cs50 submit not working for pset4

I am having problems uploading my pset4 for the last few days. I have seen that other people have had the same problem months back but browsing through the questions I have not found any solution or ...
Maja Louise Okholm's user avatar
1 vote
1 answer
290 views

Pset 4 Resize: Code works on smiley.bmp but not small.bmp

I am working on resize for pset4 and I can't get my code to work. It resizes smiley.bmp just fine but when I try to run it with small.bmp it comes back all wrong. I can't figure out what I have done ...
Antony Paolini's user avatar
1 vote
1 answer
151 views

pset4 recover - 16 images recovered with Invalid or Unsupported Image Format

I'm really confused. I reviewed all similar problems, but did find my case. It seems like jpeg start bytes are detected, but wrong data inserts to the output file. Please advise! 24-Oct-2016: The ...
Tamara Kuzhel's user avatar
1 vote
1 answer
202 views

pset 4 Do I download the Pset4 folder with all the recovered jpegs and upload it on gradebook?

I just completed pset4 and downloaded it to my pc in order to upload it in gradebook, the downloaded zip of pset4 is of about 32mb and it is not of the pset4.tar.gz format.... so I wanna confirm if I ...
Furrukh Jamal's user avatar
1 vote
1 answer
552 views

Pset4, resize, fseek, vertical scaling

I think I've gotten the horizontal resizing to work, however, I just don't get what's wrong with my vertical resizing. I've seen similar questions to mine, and I'm pretty sure my problem (assuming ...
Useful_Investigator's user avatar
1 vote
0 answers
272 views

sizeof BITMAPFILEHEADER

As I am working on pset4, I am a little bit curious of the size of BITMAPFILEHEADER and BITMAPINFOHEADER. So I implement printf to display the size of individual element within the BITMAPFILEHEADER. I ...
Khuong Tran Hoang's user avatar
1 vote
0 answers
999 views

pset4 how to enhance the colors in the background

How do I enhance the colors in the background. I've added white colors to the image, making it much more visible, but not sure whodunit. I am trying to enhance the sky blue in the image so that I can ...
Dylan Savoury's user avatar
1 vote
1 answer
181 views

Segmentation Fault in pset4

I keep on getting a segmentation fault on the function below and have no idea why. I used GDB to find where the fault was occurring but couldn't figure out any more than that. // keep playing until ...
Mike Ridley's user avatar
1 vote
1 answer
122 views

what's the error in the below function

I tried to make my own function in pset4-breakout to move the paddle but when i run and take my mouse to the output window I always get segmentation fault. I have tried gdb also but still i'm not able ...
Anmol Narang's user avatar
1 vote
0 answers
50 views

Why redefining `bool` primitives in 'SPL' as a typedef (rather than using stdbool.h)?

While reading through files included in /spl library (Stanford Portable Code), downloaded with pset4.zip distro, I came across this definitions in cslib.h: /* * Type: bool * ---------- * This type ...
abelinux's user avatar
  • 1,170
1 vote
0 answers
110 views

Can't run pset4 files outside of appliance

I usually use Ubuntu instead of appliance for programming, cause I feel much more comfortable that way and Ubuntu is the OS I use everyday. For that reason, I have downloaded the C compiler and the ...
Ice32's user avatar
  • 58
1 vote
2 answers
95 views

Problem uploading pest

I have tried to upload the zip file with my pset4 code to the CS50 submit function several times. I can add the files, but when I hit the upload button, the file appears to upload (the bottom green ...
northshoredad's user avatar
1 vote
3 answers
1k views

Can't run the staff implementation

i can't run the staff implementation for any problem set, i always get the same error, it's always something like : bash: ~cs50/pset4/breakout: No such file or directory
user1383's user avatar
0 votes
0 answers
10 views

stuck on pset 4 filter : blur

// Blur image void blur(int height, int width, RGBTRIPLE image[height][width]) { RGBTRIPLE copy[height][width]; float Sum_Blue = 0, Sum_Green = 0, Sum_Red = 0, surrounding_pixels = 0; for ...
Rishav Jain's user avatar
0 votes
0 answers
22 views

Pset4: Check50 is not compiling my code for Filter-More

I tested my code and all functions seem to be working fine, I don't know what else to do. This is the output from check50, there are no warnings or hints about what I might be doing wrong. https://...
gabi's user avatar
  • 1
0 votes
0 answers
13 views

pset4 reverse, check50 says file is not reversing as specified, even though the output file has a reversed version and seems fine

#include <stdint.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include "wav.h" int check_format(WAVHEADER header); int get_block_size(WAVHEADER ...
Bijal Shrestha's user avatar
0 votes
1 answer
27 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
0 answers
143 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
0 answers
147 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
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
37 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
0 votes
1 answer
91 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
41 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
0 answers
19 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
23 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
16 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
1 answer
174 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
132 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
31 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
1 answer
23 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
369 views

CS50: Pset4: Filter-More : "filter compiles :expected exit code 0, not 2" while running Check50

My code compiles fine with no errors but when running check50 it fails at the second check saying filter compiles: expected exit code 0, not 2. Main returns 2 when more than one argument for filters ...
Tristan Wiese's user avatar
0 votes
2 answers
51 views

Hello guys... Good day. I'm currently on the pset 4 (recover). program is working well, but the (valgrind) requirement in the check50 isn't checking

#include <stdio.h> #include <stdlib.h> #include <stdint.h> typedef uint8_t BYTE; int main(int argc, char *argv[]) { // Check that command-line arguments is 2 if (argc != 2) ...
Hendrix obuks's user avatar
0 votes
2 answers
17 views

Getting segmenatation fault even though i freed memory

#include <stdio.h> #include <stdlib.h> #include <stdint.h> typedef uint8_t BYTE; int main(int argc, char *argv[]) { // Only allow 2 command line arguments if (argc != 2) ...
lukadeving's user avatar
0 votes
1 answer
57 views

PSET 4 Recover Valgrind Check

Valgrind indicates I have 49 memory blocks left to close. Otherwise, the code satisfies check50. I'm thinking I need to nest the fclose functions within the loop, but I can't get it right. Thoughts? ...
mcweebus's user avatar
0 votes
1 answer
549 views

Understanding Pset4 Recover Valgrind Errors

My code for Recover is passing all the tests in Check50 except for the final one on memory errors. When I run valgrind ./recover I get this: When I look into the details of why I'm not passing ...
getsendy's user avatar
0 votes
1 answer
131 views

Filter blur errors

I'm working on the filter-less problem in pset4. I've got all of my functions to work properly except for the blur function. I am getting the following errors I believe due to problems with how I'm ...
getsendy's user avatar
0 votes
1 answer
235 views

Pset4 (Filter-Less) Greyscale not passing check50

I tried implementing the GreyScale function but I didn't got the average values of the pixels correctly. I don't know what I'm doing wrong. Any hints will be appreciated. My code: void grayscale(int ...
Mike Osborn's user avatar
0 votes
1 answer
103 views

CS50x PSET4 (Filter) - BLUR

This code is supposed to blur an image together with other supporting files as per CS50 Pset4. I am able to compile my code with no errors and run the program but it does not seem to blur my image ...
someone's user avatar
0 votes
1 answer
40 views

My Red and Blue values are wrong but all my green values are correct. It's pretty simple what i've done. What am I missing ? Please help

void blur(int height, int width, RGBTRIPLE image[height][width]) { RGBTRIPLE tmpimage[height][width]; for (int i = 0; i < height ; i++) { for (int j = 0; j < width; j++) ...
voko axecer's user avatar

1
2 3 4 5
8