title: Loop through user input with getchar
body: <p>I have written a small script to detect the full value from the user input with the <code>getchar()</code> function in C. As <code>getchar()</code> only returns the first character i tried to loop through it... The code I have tried myself is:</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  
  int main()
  {
      char a = getchar();
      int b = strlen(a);
  
      for(i=0; i&lt;b; i++) {
          printf("%c", a[i]);
      }
      return 0;
  }
  </code></pre>
  
  <p>But this code does not give me the full value of the user input.</p>