Skip to main content

Questions tagged [calloc]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
1 answer

Pset5 why calloc works and malloc doesn't ?

I wish i could understand better the application of malloc and calloc, i was using malloc to allocate memory for the root in my code and had the following error on valgrind: ==20066== Conditional ...
Murillo Guindani's user avatar
0 votes
2 answers

Pset5 - Valgrind causes 9544106 errors, Uninitialised value was created by a heap allocation

Im unsure if there is any error in my recursion in unloading/unload to free all memory. (But i doubt so because help50 tells me all my memory were freed- 367,084 allocs, 367,084 frees) I checked ...
Yan Bo Pei's user avatar
0 votes
2 answers

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 ...
Tom L.'s user avatar
  • 7
1 vote
1 answer

pset5 tries "Segmentation fault"

My load function crashes my program. :( I use nodes similar to instruction video: // node of tries typedef struct node { bool wordEnd; struct node* next[27]; } node; // root of the tries ...
Filip's user avatar
  • 13