title: Replacing gets() with fgets()
body: <p>I've been testing this struct out and I get warning about using <code>gets</code>. Somebody mentioned to use <code>fgets</code> instead and replace the end with <code>'\0'</code>. Any recommendation how I can change my code to do that?    </p>
  
  <pre><code>void regCars(Car reg[], int *pNrOfCars) {
      char again[WORDLENGTH] = "yes", model[WORDLENGTH], tmp[WORDLENGTH];
      int year, milage;
  
      while (strcmp(again, "yes") == 0) {
          printf("Enter model:");
          gets(model);
          printf("Enter Year:");
          gets(tmp);
          year = atoi(tmp);
          printf("Enter milage:");
          gets(tmp);
          milage = atoi(tmp);
          reg[*pNrOfCars] = createCar(model, year, milage); 
          (*pNrOfCars)++;
          printf("Continue? (yes/no)");
          gets(again);
      }
  }
  </code></pre>