title: Newline stays in buffer after fgets()?
body: <p>Here is the snippet of code that is causing me problems:</p>
  
  <pre><code>#define MAX_NAME_LEN 64
  
  char choice;
  char name[MAX_NAME_LEN];
  printf("Name: ");
  fgets(name, MAX_NAME_LEN, stdin);
  choice = getchar();
  </code></pre>
  
  <p>After I enter a name and press enter, getchar() captures the newline as well instead of waiting for the next character. How can I fix my code (without something hacky like another getchar() if possible) so that getchar() will wait for a character as expected after a name is entered?</p>