小编kid*_*ove的帖子

Valgrind Memory Leak Reachable

继续获取可访问的内存泄漏printfscanf声明.我根本不需要泄漏.当我运行报告时,它说我在print语句和scan语句中得到了可达到的泄漏.我的问题是如何修复泄漏?

这是valgrind报告:

kidslove-MacBook:src kidslove $ valgrind --leak-check = full --show-leak-kinds = all ./a.out

==6405== Memcheck, a memory error detector
==6405== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et al.
==6405== Using Valgrind-3.11.0.SVN and LibVEX; rerun with -h for copyright info
==6405== Command: ./a.out
==6405== 
Enter File Name: input2.txt
1.  Print the array sorted by street.
2.  Print the array sorted by city.
3.  Print the array sorted by state then city
4.  Print the …
Run Code Online (Sandbox Code Playgroud)

c valgrind memory-leaks

5
推荐指数
1
解决办法
502
查看次数

标签 统计

c ×1

memory-leaks ×1

valgrind ×1