Hi,
I am using Xcode and i wanted to build a intelligent library database management system. I am a beginner.
I want the user to enter what he wants to do...
1) to add a book or
2) to add a new student or
3) to loan a book or... etc
I want the user to enter any string that comes to his mind and then i want to proceed on basis of that strings.
In this code i have written all the possible strings the user "could" enter.
I know i would have instead used a switch condition and asked the user to enter 1,2 or 3.. as per his choice.
But i really want to build this thing.
Is there any reason i am getting this error?
I am using Xcode(on a mac).
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
|
void adminmenu()
{
sleep(2);
cout << "What would you like to do? " << endl;
string input;
getline(cin,input);
if (input == "Add a book" || input == "add a book" || input == "I would like to add a book" || input == "i would like to add a book" || input == "I want to add a book" || input == "i want to add a book" || input = "I just want to add a book" || input =="i just want to add a book" || input == "add book" || input == "Add Book" || input == " Add book" || input == "addbook" || input == "ADDBOOK" )
{
cout << "Processing input..." << endl;
sleep(2);
}
}
|
I am getting this error:
Invalid operands to binary expression ( ‘bool’ and ‘strings’ ( aka ‘basic_string<char,char_traits<char>,allocator<char> >’))