valgrind / gdb should have made this painless, especially for small self-contained uni projects :) I remember being a teaching assistant for some C++ courses while being a student and the "Are you a wizard?" expression on the undergrads faces when I'd recompile their segfaulting app with debug, run gdb and tell them exacly which line was causing the problem.