Printf doesn’t print anything

In this post, some advise for beginners.

Do you need print some debug info using printf and it print at the wrong time or does not print nothing? Don’t remember to flush the buffer, which is in the output. You have to use command fflush ().

Printf ("Some debug information");
fflush (stdout);

Stdout is the abbreviation for the standard output to the console. Fflush command can be used when working with files too. In this case, with variable of type FILE *.

This entry was posted in C/C++. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *


You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>