title: How to find an element of an array then adding it to another array with user input?
body: <p>For a programming project we have to make a menu that manages an inventory of books to be bought and sold. One of the menu options is supposed to add a book from the store's inventory into the customer's shopping cart. The user should be able to type the title of the book then the program would search the inventory array and find the book.</p>
  
  <p>Here's what I have:</p>
  
  <pre><code>void Customer::addBook(Customer cust, Book bookList[]) {
  string choice;
  int i = 0;
  int gotIt = 0;
  cout &lt;&lt; "Please enter the name of the book to add to your shopping cart (case sensitive)" &lt;&lt; endl;
  cin &gt;&gt; choice;
  while (i &lt; 22 &amp;&amp; gotIt == 0) {
      if (choice == bookList[i].getTitle()) {
          cust.shopCart[cust.size] = bookList[i];
          gotIt = 1;
          cust.size++;
      }
  }
  </code></pre>
  
  <p>This function is being called from a switch statement. When I type in the title of the book I want to add to the cart, the program does nothing. I think their might be an issue with how I'm comparing the user entered string and the title of the book they're looking for.</p>
  
  <p>Would someone point me in the right direction?</p>