title: How the scanf function works?
body: <p>I have coded the following codes,but there was a problem</p>
  
  <pre><code>char p[20];
  int n;
  errno = 0;
  n = scanf("%[^\n]",p);
  if (1 == n)
  {
      printf("%s\n",p);
      scanf("%[^\n]",p);  /*no waiting for input*/
      printf("%s\n",p);
  }
  </code></pre>