Questions tagged [calloc]

The tag has no usage guidance.

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

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 ...
0
votes
2answers
158 views

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 ...
0
votes
2answers
385 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
159 views

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 ...