Questions tagged [week5]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
1 answer
270 views

Pset 5: Code can't handle basic words and substrings properly

When I run my code, there is only one word in dictionary, so I am assuming that there is a problem with my load function, but I can't find where the problem is. Thank you! :) dictionary.c, ...
user avatar
0 votes
1 answer
37 views

speller giving error on valgrind, using 4 bytes of memory that isn't yours...indexing an array out of bounds

I think the problem with is the load() function, here is my code: bool load(const char *dictionary) { char *s = malloc(LENGTH + 1); FILE *f = fopen(dictionary, "r"); if (f == NULL) { return false;...
user avatar
0 votes
1 answer
54 views

Replacement of string with char* in any general case

Take a simple program where i want to count the number of vowels in a string, this i've easily implemented using string.h. But when i try that with char*: #include <stdio.h> int main(void) { ...
user avatar
0 votes
1 answer
971 views

Week 5 Speller Check function

I am attempting to complete week 5's "Speller" but it is not working. It compiles, but it seems that it does not check properly. My check function may be incorrect, but I cannot tell. I end up with "...
user avatar
  • 115
0 votes
1 answer
47 views

PSET5 speller: all words listed as mispelled and check50 gives substrings a sad face

I made my dictionary.c for my speller program, however... it lists the whole text as mispelled check50 gives a sad face for substrings, showing that in its testing, "cat" is listed as mispelled, ...
user avatar
0 votes
1 answer
59 views

Cs50 speller load trie failed implementation

/** * Implements a dictionary's functionality. */ #include <stdbool.h> #include <ctype.h> #include <stdio.h> #include <sys/resource.h> #include <sys/time.h> #include &...
user avatar
0 votes
1 answer
32 views

Week 5 - Speller. Instance remaining as NULL after setting inside function

I create an instance of a struct, wordTree, at the base level of my dictionary.c file. When the load function is called, the intention is that this instance gets created, and "branches" are then added ...
user avatar
  • 105
0 votes
1 answer
305 views

typedef struct declarations?

In Week 5 Linked Lists/etc... are talked about. In the stacks/queue's the structs are defined like: typedef struct { int size; int capacity; } stack; whereas he defines the "node" struct as: ...
user avatar
0 votes
2 answers
456 views

Pset4: Check50 does not work with my resize program

In my solution biSize and biSizeImage are correct. Checking the headers and the data in the BMP shows correct re-sizing for n = 1, 2, 3, 4, ... Check50 returns: :) resize.c and bmp.h exist :) resize....
user avatar
0 votes
1 answer
152 views

Week 5 Walkthroughs

I am trying to get Button.c to work, which is the first of the Walkthroughs from Week 5. I transferred the spl folder to my current directory, altered the Makefile from Breakout so it is working on ...
user avatar
0 votes
1 answer
63 views

valgrind free and leaks

In the continued lecture of week 5, it is stated that if we don't free memory in our programs, this can lead to a memory leak. But, just to be clear, when my program exit, all the memory used by my ...
user avatar
  • 157
0 votes
1 answer
61 views

Pset5 is missing from the web site

I just watched the Week 5 lecture and now I notice there is no pset5 accessible on the web site. Do I miss something here? I also notice that there is no Week 6 on the web site.
user avatar
0 votes
0 answers
1k views

How do I link the Stanford Portable Library (SPL) to a program?

I was on the walkthroughs of week 5 and I wanted to do the programs mentioned for practice with GButton, GCheckbox and so on. On the header files there is the #include gevents.h gobjects.h and so on, ...
user avatar