运行此工具,在opt下,运行如下两个指令。gcc –g sample.c –o sample图1运行Valgrindvalgrind --tool=memcheck ./sample