title: Use csv file to populate class data, then add node to a vector
body: <p>I have a class called <code>Node</code>. <code>Node</code> requires 4 pieces of data, <code>name</code>, <code>referenceNumber</code>, <code>latitude</code> and `longitude. </p>
  
  <p>I wish to populate these data values with the data stored in a csv file. </p>
  
  <p>Once the <code>Nodes</code> data is set it will be stored in a vector array</p>
  
  <p>I was thinking of doing this by reading the file 1 line at a time to a string and then splitting the string at the commas to a array then using the array to populate the class values. I would then push the node in to the vector array.</p>
  
  <p>The desired result would be able to search the vector for a certain node and then view the nodes info</p>
  
  <p>EDIT</p>
  
  <pre class="lang-cpp prettyprint-override"><code>vector&lt;Node*&gt; mPlaces;
      string line, refHolder, latHolder, longHolder;
      ifstream finPlaces("Places");
      if (finPlaces.is_open)
      {
          while (getline(finPlaces, line))
          {
              stringstream ss(line);
              getline(ss, mName, ',');
              getline(ss, refHolder, ',');
              getline(ss, latHolder, ',');
              getline(ss, longHolder, ',');
  
              mReferenceNumber = stoi(refHolder);
              mLatitude = stof(latHolder);
              mLongitude = stof(longHolder);
  
  
          }
  
  
          return true;
      }
      return false;
  </code></pre>
  
  <p>This is what I came up with in the end. </p>
  
  <p>I am still struggling with how to add the <code>node</code> to my <code>vector</code> any tips on how to do this? </p>