title: getchar does not stop when using scanf
body: <p>I have a difficulty understanding <code>getchar()</code>. In the following program <code>getchar</code> works as expected:</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  
  
  int main()
  {
      printf("Type Enter to continue...");
      getchar();
      return 0; 
  } 
  </code></pre>
  
  <p>However, in the following program, <code>getchar</code> does not create a delay and the program ends:</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  
  int main()
  {
      char command[100];
      scanf("%s", command );
      printf("Type Enter to continue...");
      getchar();
      return 0; 
  } 
  </code></pre>
  
  <p>I have the following weired workaround, which works, but I don't understand why:</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  
  int main()
  {
      char command[100];
      int i;
      scanf("%s", command );
      printf("Type Enter to continue...");
      while ( getchar() != '\n') {
        i=0; 
      }
      getchar();
      return 0;    
  }
  </code></pre>
  
  <p>So my questions are:<br>
    1. What is <code>scanf</code> doing?  Why does <code>scanf</code> do this ?<br>
    2. Why is my work around working?<br>
    3. What is a good way to emulate the following Python code:  </p>
  
  <pre><code>raw_input("Type Enter to continue")
  </code></pre>