December 2018
 
 
by @mw

Buffered C# output

It may happen that even if the C# programs are compiled without errors, there is no program output in the console. The reason can be that while the output of the program is being buffered it is not displayed to the end user immediately. It is difficult to say why this exactly happens, as this can be system- or compiler-specific. However, there is a simple remedy.

To unbuffer the output, you will need to flush it with
fflush();
function after the buffer is used. On the example of the Granger causality Diks-Wolski codes (you can find them here), find the first occurrence of
printf();
function and just flush it right after
printf("Input file (X): "); 
fflush(stdout);
In the example above
stdout
is the standard output buffer. It is the default file descriptor where a program can write its output. The default of the standard output is the screen.


Warning: Undefined variable $totalpages in /data/web/virtuals/381843/virtual/www/blog.php on line 169

Warning: Undefined variable $failure in /data/web/virtuals/381843/virtual/www/blog.php on line 232

Warning: Undefined variable $check in /data/web/virtuals/381843/virtual/www/blog.php on line 232

Warning: Undefined variable $failure in /data/web/virtuals/381843/virtual/www/blog.php on line 277

Warning: Undefined variable $check in /data/web/virtuals/381843/virtual/www/blog.php on line 277

Leave your comment


Warning: Undefined variable $error_id in /data/web/virtuals/381843/virtual/www/blog.php on line 358

Warning: Undefined variable $error_author in /data/web/virtuals/381843/virtual/www/blog.php on line 358
value = "
Warning: Undefined variable $post_author in /data/web/virtuals/381843/virtual/www/blog.php on line 358
" style="float:left;width:45%;font-size:12px;">
Warning: Undefined variable $error_captcha in /data/web/virtuals/381843/virtual/www/blog.php on line 364
>



Warning: Undefined variable $totalpages in /data/web/virtuals/381843/virtual/www/blog.php on line 388
M. Wolski
Marcin Wolski, PhD
Climate Economist
European Investment Bank
E-mail: M.Wolski (at) eib.org
Phone: +352 43 79 88708

View my LinkedIn profile View my profile
View my IDEAS/RePEc profile  IDEAS/RePEc