Questions tagged [load]

the first part of pset5, loading a dictionary into memory

Filter by
Sorted by
Tagged with
0
votes
2answers
56 views

Exiting nested loops

I started off pset5 with a really simple hash function, where words are indexed according to their first letter, so a would be 0, b = 1 etc. Then I insert a piece of code into the load function, which ...
0
votes
2answers
323 views

Segmentation fault in `load` function of pset6

When I try to run my program, a segmentation fault results. I don't think I am accessing memory that I am not supposed to. Is my code fundamentally wrong? bool load(const char* dictionary) { FILE*...
0
votes
1answer
103 views

Trouble with Substrings in Check in Pset5

I have used a trie structure to implement my dictionary in pset5 and I believe my load() function is operating correctly, however I seem to be having trouble with checking substrings in the check() ...
0
votes
1answer
96 views

End of file not found, why?

Help! i'm completely stuck is this code. After using a lot of gdb, i found out that when the end of file is reached the for loop (for(letter = fgetc(inptr); letter != '\n'; letter =fgetc(inptr)) //...
0
votes
1answer
82 views

Pset5 compile but report segmentation fault inside load

HELP!! I'm finally able to make my code compile without error. I know it won't guarantee it'll work, but at least I can move to the next step. :-) When I run the code it gives me segmentation fault in ...
0
votes
1answer
298 views

pset5 speller trie load - Dictionary not loading

I am working through pset5 using the trie data structure and it has been very challenging. I finally have code that compiles but when I run it against cat.txt using the small dictionary it returns all ...
1
vote
1answer
25 views

PSET 5 Load Function woes

Back with more questions about my code. 1) fscanf: When using fscanf do we need to iterate through what it is writing to the buffer to check for the null signifier so we can jump in and strcpy that ...
0
votes
1answer
221 views

PSet6 Load function doesn't load any image

My load function doesn't seem to load any image, but it always says "200 OK". For example: cat.jpg doesn't load in the browser, but the message with OK always shows up. Code: bool load(FILE* file, ...
1
vote
1answer
434 views

PSET5 How can CHECK have access to the loaded dictionary?

I'm now working on the implementation of CHECK subfunction. I think I'm on the good way, but my major problem at this moment is to link CHECK with the loaded dictionary. I'm pretty sure I can't access ...
0
votes
1answer
158 views

Problem in load function

Why does the code in the wile loop inside the load function only get executed once? /** * Implements a dictionary's functionality. */ #include <stdbool.h> #include <stdio.h> #include &...
0
votes
2answers
365 views

CS50 Speller all words shown as misspelled

I'm having difficulty with CS50 speller. With the code below, all words are showing as misspelled, so there's obviously something (or many things) wrong with my load and/or check functions. I'd ...
0
votes
1answer
95 views

pset5 - almost all words misspelled

I'm having trouble with the implementation of the PSET5 spell check code. I've looked through a lot of CS50 Stack Exchange posts, but haven't found any help. The problem is either in the check or in ...
0
votes
1answer
133 views

pset5 speller load, please let me know if this makes sense

I'm having a really hard time with pset5.. I think I 'vaguely' understand the flow from the walkthrough, but it's really difficult for me to implement it in code.. I tried to 'collage' every element ...
0
votes
1answer
188 views

PSET5 Dictionary.c issues with implementing Load using trie

I've written some lines of code to implement the trie alogorithm for loading the dictionary. I'm facing the following issue: Compiling speller.c is giving me some errors, one of which is the below: ...
0
votes
1answer
108 views

pset5 Aborted (core Dumped)

I have been trying to debug this for over 2 days now. Can't seem to locate the reason why there's a segmentation fault. Running this returns a bunch of misspelled words plus an error message - ...
0
votes
1answer
297 views

pset5 load with a trie Killed

I'm having a lot of trouble with my pset5. I'm attempting to use a trie to load the dictionary. It will compile but nothing really more than that. when using gdb, the program shows "Killed" in the ...
0
votes
1answer
45 views

Help with speller load function on PSET4

I have been stuck on pset4 for quite some time without any meaningful progress. After re-watching the walkthroughs and reading answers here I've sort of put together a "frankenstein" thing for the ...
1
vote
1answer
397 views

Help with PSet 5 Load Function

I hope you are well. I am currently on pset 5 where you have to write a spell checker. I am stuck on the load function. I am able to get stuff into my linked list. when I make and run it, I get a ...
1
vote
1answer
531 views

Pset5 Speller load() function completely stuck (trie)

I am completely stuck on pset5 load() function, have no idea where to go. Can someone please guide me in the right direction? Here is my code: bool load(const char* dictionary) { // TODO FILE* file = ...
0
votes
1answer
115 views

recursive trie generation segfaultin

Halp, I'm trying to implement a clever and zippy recursive trie makin function for load() in pset5, but my program's exploding when I trie, and I'm struggling to educe the problem (probably an ...
0
votes
1answer
722 views

pset5 trie load function killed with large dictionary

This has been bugging me for weeks. The program seems to run OK with small dictionaries, but gets killed with medium size - after around 95,000 words - it varies. LETTERS is set to 27. Any help would ...
0
votes
2answers
158 views

Segfault in pset5 in load

My implementation of load uses a trie and when I attempt to access the bool is_word I get a segfault. Can you guys help me out? Any suggestions on how to improve my code would be amazing. Thanks ...
0
votes
2answers
393 views

pset5 valgrind not happy with load (also, using malloc vs calloc on trie)

First, valgrind flags the file pointer at the fopen call, and also the malloc call to the root pointer. It designates both still reachable in loss record. Second, since for pset5 I check for an end ...
1
vote
1answer
225 views

PSET5 How can I test my code with small dictionary?

I'm trying to test my implementations of LOAD and CHECK with small dictionary of cs50 appliance, but it's look like I do the wrong thing... Someone can help me with that please! Thanks jharvard@...
0
votes
1answer
604 views

pset5 load speller.c, seg fault with gdb

Changing this question to be specific. My load function seems to run past the end of the cs50 small dictionary to give a segmentation fault after it works for cat and caterpillar. I can see that cat ...
0
votes
1answer
123 views

STUCK ON LOAD FUNCTION SPELLER.C/PSET5

I am stuck on load function does compile but doesn't load the dictionary.Any suggestions will be appreciated!
0
votes
1answer
68 views

Speller week 5 Segmentation fault

I can't understand where and what my error is I think it's because of "load", but I can't fix it it returns an error when checking :) dictionary.c, dictionary.h, and Makefile exist :) ...
0
votes
1answer
362 views

Pset 5 Load Function

I'm having trouble with my load function... I had it working previously, but after changing some stuff and dealing with the check, I ran into this issue and can't seem to figure it out... Every time ...
0
votes
1answer
139 views

i don`t know what is wrong with my unload function?

enter code here /** * Implements a dictionary's functionality. */ #include <stdbool.h> #include<cs50.h> #include <strings.h> #include <stdio.h> #include <...
0
votes
1answer
120 views

Pset6: Getting 200 OK response, but cannot upload code to check50

Was wondering if anybody could take a look at my code and find any issues. I ran check50 after implementing lookup and parse, and I passed everything, so I am assuming the problem is in my load and/or ...
0
votes
1answer
547 views

Insert nodes into trie for Load

I'm not quite sure how to iterate through a string and malloc a new node to properly insert each letter into a trie for pset5/6 (2014/15). Here is the relevant code that I've come up with so far, ...
0
votes
1answer
231 views

How do I load words in speller that are mixed letters and numbers?

I'm struggling with pset 6 (quite difficult logical and implementation wise, but I like this level of difficulty and this challenge). I'm implementing load and I just found out that I'm 34 words off ...
1
vote
1answer
330 views

PSET5 - Issues with initialization of pointers in LOAD function

I'm still trying to debug my load function, I rewrite my code again and again but with no result... I know we need to have specific question, but now I just have so many questions. So, I'll go with ...
0
votes
2answers
56 views

Pset5 - Speller - Valgrind error for malloc in load function

I get all test results correct except the Valgrind error as follows, does anyone know why is it so and share some insights please? thanks! running valgrind --show-leak-kinds=all --xml=yes --xml-file=/...
0
votes
1answer
392 views

How can I debug my load() function in Speller?

So I have code that I feel as though should be working, but I'm having trouble checking my work. I wrote a function that I think loops through my table, but it only displays half of the data seemingly....
0
votes
1answer
77 views

Declaring a node (a struct pointer) from a function

I'm tackling load and decided to make a create_node function for allocating memory, NULLing all children and setting is_word as false. What I wrote is essentially the same as in this question struct ...
0
votes
1answer
91 views

Logic Error in speller.c - Can't open text file and also have doubts about load() and check()

I wrote check() and then I tried to test speller with dictionary/small and a text file I'd written myself, but the text file couldn't be opened. Is there a problem with the way I implemented load() ...
0
votes
2answers
85 views

strcpy not working with struct items

bool load(const char *dictionary) { char splitStrings[9999][45]; FILE* dict = fopen(dictionary, "r"); node* item = table[0]; int i = 0; for (i = 0; fscanf(dict, "%...
0
votes
1answer
362 views

Pset5 Speller Load - Segmentation Fault - Valgrind error: Invalid read of size 8

this is my first post to this forum so I hope I've followed correct procedure. I get a segmentation fault when I run speller. Valgrind says the problem is "Invalid read of size 8" at line 114 in the ...
0
votes
1answer
19 views

My load function is licking memory

the program complies properly but when i use valgrind shows am leaking memory when I open the file in the FILE *file = fopen(dictionary, "r"); bool load(const char *dictionary) { // TODO ...
0
votes
2answers
34 views

PSET5 Speller Load function skips the words from the dictionary

Struggling with the load function in speller for second week now. What I found using debug50 and placing "printf" between different lines of code is that the fscanf reads every second word ...
0
votes
1answer
39 views

All words are returned misspelled

I'm running this program on a small dictionary and a small text sample. I think that loading the dictionary is working correctly. But how can I know for sure? When I implement the load and check ...
0
votes
1answer
80 views

PSET6 - Double free error

I'm getting stuck in the last lines of PSET6. Apparently the problem is in the LOAD function. Check50 server2 getting all but 1 lines marked red :( and when running the program I get * Error in `./...
2
votes
2answers
91 views

2019 PSET4 SPELLER, I have no clue why it isn't working, I'm sure size and unload function is right, but unsure about load and check

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

PSET5. Free a variable outside a loop. leaking memory

I've been stuck for days in the implementation of LOAD with a TRIE data structure. I think my code works (well it doesn't show seg faults) but I am getting a lot of memory leaks. I implemented the ...
0
votes
1answer
46 views

For the spell checker, isn't the dictionary data structure only made of local variables?

For the spell check program, we have to read the dictionary from a file into a data structure (e.g. linked list, hash table with linked lists, a try). However, we have to do this within the function ...
0
votes
1answer
21 views

cs50 Speller Question

I am currently working on the load function in Speller. When I run it with a file, most of the words are mispelled, leading me to believe that initializing my list works correctly, until it adds ...
0
votes
1answer
30 views

Pset5 load problem: Dictionary cannot be loaded

I run my code and it cannot load the dictionary. I'm not sure if the problem is with my code or the file location. Anybody knows why? Thanks in advance.
0
votes
1answer
55 views

Segmentation fault in pset5/speller while linking newNode with the linked list

I have been trying to resolve errors in my speller "load function". I have been able to resolve a couple of them except this one. Debug50 reveals that while creating a link between new Node and the ...
0
votes
1answer
60 views

Pset5 problem with load function : Keeps getting segmentation fault

I have been working on pset5 and i keep getting segmentation fault while trying to implement 'load' function. I cannot really see where is the problem. Any help will be really appreciated! Here's my ...

1
2 3 4 5
8