title: Program doesn't execute gets() after scanf(), even using fflush(stdin)
body: <p>After wasting too much time searching why my program doesn't execute gets() after using scanf(), I found a solution which is to use fflush(stdin) after scanf() to enable gets() to get a string.</p>
  
  <p>The problem is that fflush(stdin) doesn't do what is expected from it: The program continues skipping gets() and I can't write any phrase in the console to be read.</p>
  
  <p>My code is the next one:</p>
  
  <pre><code>#include &lt;string.h&gt;
  #include &lt;stdio.h&gt;
  
  int main(){
      char nombre[10];
      char mensaje[80];
  
      printf("Type your name:\n");
      scanf("%s", nombre);
  
      fflush(stdin);
  
      printf("Now, type a message:\n");
      gets(mensaje);
  
      printf("3/%s:%s",nombre,mensaje);
      return 0;
  }
  </code></pre>