Questions tagged [helpers]

The tag has no usage guidance.

18 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
1
vote
1answer
37 views

It says: helpers.c compiles expected exit code 0, not 1 (I really don't get it)

#include <cs50.h> #include <math.h> #include <string.h> #include <stdlib.h> int duration(string fraction) { int x = atoi(&fraction[0]); int y = atoi(&fraction[...
0
votes
1answer
79 views

PSET 3 Music doesn't give correct frequencies

After I finished up to problem set 4, I went back to submit my old Psets, but to my surprise many of the had errors, this being one of them. My code compiles fine, but doesn't give the correct ...
0
votes
1answer
109 views

Pset3 Helpers.c “timing out while waiting for program to exit”

I have been working on Helpers.c for an extremely long time now, and I have little help with the style of the program due to my doing this totally on my own. When I run check50 from the 2018 pset3 doc,...
0
votes
1answer
35 views

pset3 keeps returning 1 even when it should return 0

bool search(int value, int values[], int n) { // TODO: implement a searching algorithm if (value < 0) return false; int s = 0; int e = n - 1; int m = ((s + e) / 2); while (s <= e) { ...
0
votes
1answer
119 views

Pset 3 helpers.c check 50 errors

#include <cs50.h> #include <stdio.h> #include "helpers.h" //TODO binearysearch, om te controlere van de waarde. bool search(int value, int values[], int n) { int left = 0; int ...
0
votes
1answer
75 views

pset3 find, failing half the checks!

so currently doing pset3 & i think my sort function is all good (i've printf'd each value & it's all in the right order), but when trying to implement binary search it's failing half the tests ...
0
votes
1answer
86 views

PSET3 helpers.c

:( finds 42 in {42,40,39,41} \ expected an exit code of 0, not 1 What can I make out of this error message. Here's my code for binary search,selection sort:
0
votes
0answers
83 views

pset3 why did this cause a segmentation error but only sometimes with same input?

So I was running into an issue with my counting sort algorithm throwing segmentation errors sometimes. The offending code: while (count < n) { while (counting_array[j] > 0) { ...
0
votes
1answer
127 views

Segmentation fault on pset3 (find : more comfortable)

My program got a problem when I used this command './generate 1000 50 | ./find 127' which generating random number to run it. It shows "Segmentation fault", but it works fine when I type the input ...
0
votes
0answers
50 views

Result doesn't match expected output

I just finished the helpers.c pset, where you have to implement a counting sort and then a binary search. I havent made it recursive yet but it works in all of my own test cases. I also ran the ./...
0
votes
1answer
524 views

CS50 Problem Set 3 Helpers.c PROBLEMS

I have been trying to solve Pset3 search and sort - looked at all possible online forums but I cannot solve it. Please help. Where am I going wrong? Is my binary search OK? What about my bubble sort? ...
0
votes
1answer
97 views

pset3 binary search , problems with check50

i have tried a lot but cannot find the meaning of the last two errors of check50 please help
0
votes
1answer
90 views

pset 3 mergesorting in helpers.c is giving me a segmentation fault

I have been trying to implement mergesort for the "sort" part of pset 3 - but it is giving me a segmentation fault every time I try. Help :/ void sort(int haystack[], int n) { int temp[n + 1 / 2];...
0
votes
1answer
387 views

killed by server

) helpers.c exists :( helpers.c compiles \ killed by server :| finds 42 in {42,43,44} \ can't check until a frown turns upside down :| finds 42 in {41,42,43} \ can't check until a frown turns ...
0
votes
1answer
794 views

pset3 helpers.c linear search confusion

bool search(int value, int values[], int n) // TODO: implement a searching algorithm if (n >= 0) { for (int i = 0; i < n; i++) { if (values[i] == value) ...
0
votes
1answer
185 views

PSET 3, Bool problem

I dunno why doesn't run! I've tried many things and nothing. The compiler yells saying: «conflicting types for 'search'». Any help, please? Here's my code: #include <cs50.h> #include <...
0
votes
1answer
470 views

helpers.c not exist

When I used check50, show this bug... I understand that "helpers.c" is not compile, but in MakeFile all looks good. I'm in the step of binary search and sort. What can I do to find the error? ...
-1
votes
1answer
91 views

I wish I could. I need a bit of help on these errors when I make helpers.c

ers.c:8:2: error: '/*' within block comment [-Werror,-Wcomment] //**************************************************************************/ ^ helpers.c:16:6: error: redefinition of 'search' bool ...