I know I'm probably doing it wrong. My intention is to have the user enter a book title. If they enter a title that's already in the "system", I want a while loop to allow the user to keep entering a book title until it doesn't match one in the system. (Basically, it's checking to see if the book title isn't already in use. If it is in use, the program asks for a different title before writing it down into the system)

I thought I could pass a boolean variable to my class-member-function to use in my while-loop in main function. I'm having problems with that. Can anyone help me understand what I'm doing wrong or how I could perform this task a better way?

Summary: I want to pass/return a Boolean variable so use in a while loop. Any suggestions, hints?

(Note: The problem I'm referring to is in Main function - Case 1.)

Code:
#include <iostream>
#include <string>
#include <fstream>
#include <iomanip>
#include <conio.h>

using namespace std;

//Book: Title, Author(s), publisher, ISBN, price, and Year of Publication
class bookType
{
      private:
              string bookTitle;
              string bookAuthor[4]; //Up to 4 authors.
              string bookPublisher;
              int bookISBN;        //10 digit number code
              double bookPrice;
              int bookNumCopy;
      public:
             
              void showTitle();   //Display title
              void setTitle(string);    //Set the Title
              void checkTitle(string, bool);  //check the title.
              
              void showAuthor();
              void setAuthor(string);
              void checkAuthor();
              
              void showPublisher();
              void setPublisher(string);
              void checkPublisher();
              
              void showISBN();
              void setISBN(int);
              void checkISBN();
              
              void showPrice();
              void setPrice(double);
              void checkPrice();
              
              void showNumCopy();   //Show number of copies
              void setNumCopy(int);    //Set number of copies
              void updateNumCopy(); //Update number of copies
              void returnNumCopy(); //Display number of copies
};

//Search for book by title
//search by ISBN, and update number of copies.

void bookType::showTitle()
{
     //Display title
     cout << bookTitle;
}

void bookType::setTitle(string title)
{
     //set the title
     bookTitle = title;
}

void bookType::checkTitle(string chkTitle, bool search)
{
     //Search for title
     if (chkTitle == bookTitle)
        cout << "1 Book(s) found with that title.";
        search = true;
        return search;
     else
        cout << "0 Book(s) found with that title.";
        search = false;
        return search;
}

int main()
{
 bookType aBook[100]; //100 instances of the book class
 int choice; // for the main menu
 string title; // for setting book title.
 bool search; //Will be used for setting titles.
 //BookInt - Book instance. For incrementing.
 //for loop for check title in case 1.
 //Change while Case 1 to write over.
 
 cout << "****Book Store****" << endl
      << "1 - Set Title "     << endl
      << "2 - Search Title "  << endl;
 
 cin >> choice;
 switch(choice)
 {
    case 1:
         cout << "Enter a book title: " << endl;
         cin >> title;
         aBook[0].checkTitle(title, search);
         while(search = false)
         {
            cout << "Book Title already in use. Please enter another.";
            cout << endl;
            cin >> title;
            aBook[0].checkTitle(title, search);
         }
         aBook[0].setTitle(title);
         break;
    case 2:
         cout<<"Enter a book title to Search: ";
         cin>>title;
         for (int x = 0; x < 100; x++)
         {
           aBook[x].checkTitle(title, search);
         }
         break;
    default:
            cout << "No such option!" << endl;
}
 
 /*
 if choice == 1
    cout<<"Enter a book title: ";
    cin>>title;
    aBook[0].setTitle(title);
 else 
      if choice == 2
*/    
 
 
 getch();   
}
'search' is my bool. I'm trying to pass it to a class function and have it return. The compiler has a problem with that. I'm sure I'm going about this the wrong way.

Thank you, for looking.