Linked Questions

0
votes
0answers
326 views

CS50 - PSET2 - Substitution Segmentation fault

I keep getting 'Segmentation fault' every time I run the code(mentioned below). The code is compiling just fine. It's asking for input and is returning required message when the command line argument ...
0
votes
1answer
205 views

:( handles lack of key or argv[1] failed to execute program due to segmentation fault

#include <stdio.h> #include <cs50.h> #include <string.h> #include <ctype.h> #include <math.h> #include <stdlib.h> int main(int argc, string ...
0
votes
1answer
144 views

SPELLER(pset5), output of misspelled words is more than actual

There are two problems with the code: WORDS MISSPELLED are around five time normal. It is showing 5440 misspelled words while ideally there are around 900 such words(staff's solution). In the bool ...
0
votes
1answer
158 views

Having problems with plurality for cs50

I am trying to run the program for plurality for cs50, and the program compiles I put my candidates in and number of voters and vote, but instead of printing the winner it gives me a segmentation ...
0
votes
1answer
121 views

i keep on getting segmentation fault in pset5

// Returns true if word is in dictionary else false bool check(const char *word) { //change letters to lowercase int length = strlen(word); char copy[length + 1]; for (int i = 0; i < length;...
0
votes
1answer
98 views

PSET 2 Substitution

My question is about a cs50 PSET. The goal is to create some sort of encryption program. From command line arguments there is a key inputted and every key letter should be replaced with the alphabet ...
0
votes
2answers
36 views

Getting a segmentation fault in pset4 recover

I'm getting a segmentation fault when trying to run my program for pset4 recover. I've been trying for ages to debug it, but I'm finding it really difficult because when I try to use debug50, after ...
0
votes
1answer
75 views

pset3 record_prefernces : i have segmentation fault error

i'm trying to implement record_preferences function but when i try to run the program it stops after getting first voter choices sorry for my messy thanks in advance the code :
0
votes
1answer
93 views

Getting a segmentation fault when i try to run pset5 speller and i'm not sure what's the problem. Appreciate it if someone can explain. thanks!

// Implements a dictionary's functionality #include <stdbool.h> #include "dictionary.h" #include <stdlib.h> #include <stdio.h> #include <string.h> #include <...
0
votes
1answer
54 views

Fatal error “segmentation fault” when trying to run program

My program readability.c compiles and gets input. It's supposed to return the number of letters in the input text. I'm getting this error instead of the answer. If you can help me you'll be welcome. ...
0
votes
1answer
68 views

CS50 pset5 segmentation fault

I've spent a whole day trying to solve pset5. When i try to run the code it kept showing "Segmentation fault". Here's what i get from Valgrind ==21210== HEAP SUMMARY: ==21210== in use at ...
0
votes
1answer
65 views

Pset4 'Recover' - Help! How can I solve this segmentation fault?

For pset4 'Recover', I'm facing a segmentation fault but I cannot find what I did wrong in my code. If I use echo$? to find where the bug is, it returns the value 1. Can someone help me to point me in ...
0
votes
1answer
64 views

PSET4 - Need help with Recover problem

I am stuck in this problem, when I run it I keep getting a segmentation fault. I think that the bug in my code is in the while loop. In the walkthrough of the problem it was suggested to check if ...
0
votes
1answer
49 views

Why do i get these errors? i am new to programming so please be easy on me. The errors are in the body

#include<stdio.h> #include<cs50.h> #include<string.h> #include<ctype.h> bool check_validity_key(string s); int main(int argc, string argv[]) { if (!check_validity_key(argv[...
0
votes
1answer
34 views

Plurality works perfectly with debug50, but it does not without it

I've been working for weeks on pset3 - plurality, and all my logic is working fine in debug50, but not in real execution. It gives me either "segmentation fault" or (null). Basically, my ...

15 30 50 per page