3 ms·
Agree. The best way to manage memory in trivial, one-off C programs is not managing it at all. Don't try to free() everything. When I first started to write in
by segfaultbuserr 7y ago
Agree. The best way to manage memory in trivial, one-off C programs is not managing it at all. Don't try to free() everything. When I first started to write in C, I attempted to free() whenever I have a chance to, no matter how trivial the program is. Later a textbook convinced me that the effort is not worthwhile (unless for learning C) if all your program does is some simple calculation or processing.