Register
Log in
Username:
Password:
4coder
Blog
Forums
Wiki
Library
4coder
»
Forums
»
MSVC Compiler don't see output of printf
← Back to index
NayGames
Adrien
7 posts
#23052
MSVC Compiler don't see output of printf
7 months, 3 weeks ago
Edited by
Adrien
on
July 12, 2020, 2:29 p.m.
Reason: Initial post
For exemple I saw 'hey!' only when I close the executable.
1
Print("Hey!\n");
mrmixer
Simon Anciaux
957 posts
#23055
MSVC Compiler don't see output of printf
7 months, 3 weeks ago
To be clear, you're trying to run one of your executable from 4coder ?
Could this be similar to this issue:
printf to buffer only appearing after buffer get to a size
?
Try adding
fflush( stdout );
after the prints to make sure they go out to the screen.
NayGames
Adrien
7 posts
#23056
MSVC Compiler don't see output of printf
7 months, 3 weeks ago
Okay if I add fflush( stdout ); it work. But they is no other solution to just add fflush( stdout ); after each printf ?
mmozeiko
Mārtiņš Možeiko
2177 posts / 1 project
#23058
MSVC Compiler don't see output of printf
7 months, 3 weeks ago
You can disable buffering on stdout with this:
1
setvbuf(stdout, NULL, _IONBF, 0);
http://sscce.org/
http://xyproblem.info/
http://www.catb.org/~esr/faqs/smart-questions.html
← Back to index
Log in
to reply