title: How do I read a string entered by the user in C?
body: <p>I want to read the name entered by my user using C programmes.</p>
  
  <p>For this I wrote:</p>
  
  <pre><code>char name[20];
  
  printf("Enter name: ");
  gets(name);
  </code></pre>
  
  <p>But using <code>gets</code> is not good, so what is a better way?</p>