Search Results
Search type | Search syntax |
---|---|
Tags | [tag] |
Exact | "words here" |
Author |
user:1234 user:me (yours) |
Score |
score:3 (3+) score:0 (none) |
Answers |
answers:3 (3+) answers:0 (none) isaccepted:yes hasaccepted:no inquestion:1234 |
Views | views:250 |
Code | code:"if (foo != bar)" |
Sections |
title:apples body:"apples oranges" |
URL | url:"*.example.com" |
Saves | in:saves |
Status |
closed:yes duplicate:no migrated:no wiki:no |
Types |
is:question is:answer |
Exclude |
-[tag] -apples |
For more details on advanced search visit our help page |
0
votes
1
answer
29
views
Weird output compiling find
I started my code for sort, on pset 3 find, and when I try to compile it, I get an output i've never seen before, it outputs
clang -fsanitize=integer -fsanitize=undefined -ggdb3 -O0 -std=c11 -Wall -Werror … crt1.o: In function `_start':
(.text+0x20): undefined reference to `main'
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [helpers] Error 1
~/workspace/pset3/find …
0
votes
1
answer
30
views
Find.c is finding numbers that aren't in the list
I got almost all of my code to work for find, it passes all of the check50s except 1, it finds 42 in {39, 40, 41, 43} My code so far is:
/**
* helpers.c
*
* Helper functions for Problem Set 3.
* …
0
votes
1
answer
38
views
In find, I print the array before sorting it, The last number it prints out is always consis...
It continuously prints 2147483647 as the last number of the haystack, even when I use a different seed or no seed at all. Does anyone know why?
0
votes
1
answer
34
views
Binary search recursing issue
I've been working on a binary search of pset3 find, and I'm having an issue when I call the function again recursively. I believe that I know what the issue is, I'm just not sure how to fix it. …
0
votes
1
answer
41
views
Bubble sort code works, but does not stop
I fixed my bubble sort code, and it correctly sorts the numbers, but it does not stop when it should. My code is:
#include <cs50.h>
#include <stdio.h>
#include <stdlib.h>
//#include "helpers.h"
//vo …
0
votes
1
answer
55
views
Help fixing bubble sort
I've been working on implementing a bubble sort, and I can get it to swap one time through the list, but I can't get it to run more than once, and I'm not sure how to implement it. I also know that th …
0
votes
1
answer
53
views
Is this a correct way of implementing bubble sort?
I made a bubble sort code, but I want to make sure that my code is correct. My code is
void sort(int values[], int n)
{
if (n == 1) {
return 0;
}
int swapcount = 0;
…
0
votes
2
answers
114
views
Help finding segmentation fault
Sometimes, it sorts the code and finds the needle, sometimes it doesn't sort correctly and ends with a segmentation fault or can't find the needle. Please help me fix this issue. …
0
votes
1
answer
50
views
Check 50 for find
/find 42, and your numbers are 39 40 41 43, it still finds 42. …