Curious SDL question - What should it return

Hey everyone, haven't posted in a while! Just a curious question...

I've been working with SDL (my editor is code blocks for C++) and every time my program terminates, it gives me a weird return value (this is after i have successfully exited the program - no problems seen) like -10292919 or something, is this normal or should it return a 'good' value like 1 or 0.

Also another question is when i use printf to output to console. I use

1
2
	freopen("CON", "wt", stdout);
	freopen("CON", "wt", stderr);


to redirect the streams into the console instead of into a text file (it works fine), but after SDL quits, the console window just crashes and left hanging there :(.

Is this a bad thing or just a side effect?

Many Thanks, SuperStinger.
every time my program terminates, it gives me a weird return value

Where do you see this value?

the console window just crashes and left hanging there

Do you mean that the console window stays open but you don't want that?
That return value means the program closed unexpectedly. It usually happens when you click the X on the terminal.

I've had the same problem with the console window in SDL applications. I don't know of any way to fix it other than compiling as a GUI application (with no console).
hmm yes, i saw how to do it as a GUI application, but how would i do debugging for outputing certain values to console, i guess i can just stick to text files >_<.

Anyways! Thanks for all the help, much appreciated :D
Last edited on
Topic archived. No new replies allowed.