News:

Accounts with zero posts and zero activity during the last months will be deleted periodically to fight SPAM!

Main Menu

Magic debugger?

Started by sketchbr, December 03, 2008, 02:56:51 AM

Previous topic - Next topic

sketchbr

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!

thomas

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.
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."