title: implicit declaration of function 'gets' is invalid in C99
body: <p>Why am I getting this error?</p>
  
  <pre><code>implicit declaration of function 'gets' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
  </code></pre>
  
  <p>Code:</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  
  typedef struct myStruct
  {
      char name[20];
      char tel[20];
  }contact;
  
  int main(void)
  {
      contact *mycont[3];
  
      for(int i=0; i&lt;3; i++)
      {
          mycont[i] = (contact*)malloc(sizeof(contact));
          printf("Enter Name Of The Contact No.%d\n",i+1);
          gets(mycont[i]-&gt;name);
          printf("Enter The Contact Telephone Number\n");
          gets(mycont[i]-&gt;tel);
      }
  }
  </code></pre>