title: Disable buffering for stdin and stdout using setvbuf()
body: <p>When I was reading about the usage of <code>setvbuf()</code> , I came across the <code>_IONBF</code>(no buffering) mode. So I was curious how stdin and stdout will be affected if I try to disable the buffering. Below is an example code :</p>
  
  <p><b><h3>The Code : </h3></b></p>
  
  <pre><code>#include &lt;stdio.h&gt;
  
  int main(void)
  {
  
     int num;
     char a;
     setvbuf(stdin, NULL, _IONBF, 0); //turn off buffering
     scanf("%d", &amp;num);
     a = getchar();
     printf("%d %c\n", num , a);
  
         return 0;
  }
  </code></pre>
  
  <p><b><h3>The Question : </h3></b></p>
  
  <p>1.) From the above code, the sample input I've given to the program (<code>123a</code> and etc) yield the same output even if I didn't include <code>setvbuf()</code>.</p>
  
  <p>2.) I understand that buffer is an intermediate storage in which a chunk of data can be filled into it and all those data will be send to the input or output stream either when the buffer is full or a newline is given.</p>
  
  <p>3.)So what does the effect of disabling buffer? Is it in terms of performance?</p>