Code::Blocks Forums

User forums => Using Code::Blocks => Topic started by: sketchbr on December 03, 2008, 02:56:51 am

Title: Magic debugger?
Post by: sketchbr on December 03, 2008, 02:56:51 am
hey guys,
I'm making a game as a project for the university and I've come across a few problems...
When I compile and execute the project in codeblocks the program is closed during execution, which suggests some logic errors. 
That's fine. But when I debug the same project, with no alterations and no breakpoints, the game runs normally, no errors!
How is that possible?

So, that's what I want to know: in what way does debugging a project influence on it's execution?
Does it treat things like memory protection differently?

Thanks!
Title: Re: Magic debugger?
Post by: thomas on December 03, 2008, 09:36:20 am
You have something like if(ptr) *ptr = blah; or if(ptr) delete ptr; somewhere in your code, but you never initialise ptr to 0, so it points to some undefined address (which isn't 0).
The debugger initialises all variables, so it works as expected.