title: Push pointers to vector at runtime C++
body: <p>My program will read input data that contains N lines. Each line contains data that will be assigned to a single object. Since the number of objects required will be determined at runtime, I plan to allocate space for them on the heap. </p>
  
  <p>I want to include a vector of pointers to these objects. My first approach was to use a loop running N times, and allocate the space with,</p>
  
  <p><code>Customer* cust_i = new Customer</code></p>
  
  <p>Then use <code>customer_vector.push_back(cust_i)</code> to populate the vector. </p>
  
  <p>Seems clumsy, and given that I don't understand dynamic memory allocation in C++ all that well, I would appreciate any advice approaching this problem a better way. </p>
  
  <p>Thanks.</p>