title: How to compare objects in 2 vectors simply?
body: <pre><code>void compare(vector&lt;Customer&gt;&amp;compare,vector&lt;CarProperties&gt;&amp;cars,int customer_number)
  {
      int c = customer_number;
      for(int i =0; i&lt;=cars.size(); i++)
      {
          if(cars[i].getname() == compare[c].getCustomerDesiredCar())
              break;
          cout &lt;&lt; "Enter car is available for rent"&lt;&lt;endl;
      }
  }
  </code></pre>
  
  <p>Here I am comparing 2 vectors, the cars vector contain cars and compare vector comparing the user entered car name by Cars vector. Whenever i try to run this, my compiler crashes at this function, otherwise the program is running fine.</p>