title: Storing structs inside a vector with insert function c++
body: <p>I'm currently trying to write a program that is supposed to store incoming data from cin to a vector with elements of a struct-type.</p>
  
  <pre><code>struct data{
  
    int times;
    string name;
  };
  </code></pre>
  
  <p>and storing them in the vector</p>
  
  <pre><code>vector&lt;data&gt; data_list;
  </code></pre>
  
  <p>the problem I have is the syntax for storing them in the vector using the insert function.</p>
  
  <p>I've tried with <code>data_list.insert(data_list.begin(),5);</code></p>
  
  <p>for storing the int value 5 at the first index but it doesn't work. Any suggestions?</p>