title: Replacement of fflush(stdin)
body: <p>I have the below code,</p>
  
  <pre><code>fflush(stdin);
  print("Enter y/n");
  scanf("%c",&amp;a);
  </code></pre>
  
  <p>Here,it is quitting before giving the input.it looks like the issue is because it is not flushing out the input buffer which might be having some junk characters.Is there any alternative for flush(stdin).This code snippet is working in Solaris but it is not working in Linux.</p>