Developer forums (C::B DEVELOPMENT STRICTLY!) > Development

SDL - output in console doesn't work

(1/2) > >>

Feuer:
Hi there,
I create an new SDL project and everything is fine.
But, if I want an output trough printf or cout, nothing is in the console. Is there anything wrong, is it generally possible?

If you speak german, you can answer me in german :-)

Greetz

mandrav:
I believe SDL redirects all output intended for stdout/stderr to files stdout.txt/stderr.txt. Check the folder your program runs in for those files.

Feuer:
yeah, there is it, thanks

is it possible, that sdl redirect it in the console?

Phatency:

--- Quote from: Feuer on January 07, 2007, 10:05:38 pm ---yeah, there is it, thanks

is it possible, that sdl redirect it in the console?

--- End quote ---
Yes it is, just add the following lines to your code (after SDL_Init)

--- Code: ---freopen("CON", "w", stdout); // redirects stdout
freopen("CON", "w", stderr); // redirects stderr
--- End code ---

Feuer:
it works!

thanks

Navigation

[0] Message Index

[#] Next page

Go to full version