How to run valgrind with basic c example?

It looks good. You only need to add a ./ before your executable. Without it, valgrind fails to find it and reports 'command not found'.

valgrind --tool=memcheck --leak-check=yes ./example1

Leave a Comment