Best way to find memory leaks in a C program
问题 I am trying to complete a college assignment, and the marking criteria specifies 5% for memory management - specifically for having no memory leaks. As I understand it, memory leaks in simple C programs, are only caused by pointers which have become abandoned by the program - ie, malloc/calloc/etc calls which are never have a corresponding free . My question is in 3 parts: Whats the simplest way on Solaris and OSX to 'prove' that you haven't leaked any memory? Does XCode have any tools to