Tag valgrind

[Solved] Valgrind getting strange error

First of all and most importantly: This is not good C++ code, not even decent. For example, some of your #includes are wrong, like <stdio.h> should be <cstdio> instead. The worst thing here are those #defines that make your code…

[Solved] Valgrind detects memory leak, can’t find it C

Your initDictionary doesn’t return the pointer dictionary anywhere. That means when you do Dictionary* dictionary = initDictionary(); the value of dictionary will be indeterminate (seemingly random or garbage), and dereferencing this pointer or passing it to free will result in…

[Solved] Invalid read of size – C valgrind

Here after is a proposed solution in main() : List of the corrected errors and enhancements: 1- in the formatting output, replace %p (dedicated to pointers) by %s (dedicated to strings). 2- before storing in the output string zeile_array[d] allocate…