title: C Increase struct value
body: <p>I was asked to create a program where the user could add cars and I would have to save the car's brand, color, and so on. Then I have to display them, and display the ones with more sales, all that. I thought about creating a structure and saving everything there, the problem is, I don't know how many cars the user will input.</p>
  
  <p>How can I dynamically increase the structure saved values? I wanted to do something like:</p>
  
  <pre><code> struct car{
          int Bhp;
          char Brand[25];
          char color[25];
          int sales;
          float weight;
                        };
  </code></pre>
  
  <p>and then:</p>
  
  <pre><code>  struct car car1;
    struct car car2;
  </code></pre>
  
  <p>but I would have to dynamically increase the number of "cars" as the user would add more and more. Is there any way I could do that? And please explain it in a simple way, as I am still a C beginner. Thank you very much.</p>