title: Iterating the creation of objects in C++
body: <p>I want to be able to create N skyscrapers. Using an inputdata string, I would like to give them coordinate values of their X and Y positions. My main function I used &quot;i&quot; to demonstrate that I am trying to create as many skyscrapers as I can using the input data. Essentially, I would like to create N/3 skyscrapers and assign the input to coordinates for each.</p>
  <pre><code>#include &lt;iostream&gt;
  #include &lt;vector&gt;
  #include &lt;string&gt;
  #include &lt;math.h&gt;
  
  using namespace std;  
  vector&lt;int&gt; inputData = {1, 4, 10, 3, 5, 7, 9, 10, 4, 11, 3, 2, 14, 5, 5}; 
  int N = inputData.size();
  
  class Buildings{
      public: 
          int yCoordinateLow; 
          int yCoordinateHigh; 
          int xCoordinateLeft; 
          int xCoordinateRight;
  
  }; 
  
  int main(){ 
      for(int i=0; i&lt;N; i=i+3){
          Buildings skyscraper; 
          skyscraper.xCoordianteLeft = inputData.at(i); 
          skyscraper.yCoordianteLow = 0;
          skyscraper.yCoordinateHigh = inputData.at(i+1); 
          skyscraper.xCoordinateRight = inputData.at(i+2); 
      }
      return 0;
  }
  </code></pre>