Hi i've been making a game in c++ and SDL (codeblocks IDE) and my program terminates unexpectedly on occasion giving no clear error message.
Now i have around a thousand lines of code so i dont really want to go searching through it all for the reason this is happening.
Does anyone have any tricks for finding this sort of thing?
(more details coming shortly need to trigger the termination first)
edit: actually having trouble triggering atm. Doubt i have fixed it so will keep trying.
The trick is called debugging. Select Debug/Start or "Step Into". Make sure "Debug" is the active target.
Now when a segmentation fault happens, you can see which line caused it, you see the function callstack and you can check values of variables (such as function parameters).