i'm new to c++. i started with the following code and i have an, ISO C++ forbids comparison between pointer and integer ERROR. My my program is for a library. i am now trying to have it pull up my file and read then edit a bookfile. the area in red is where i started having problems. im not sure where im going wrong please help:
#include <iostream>
#include <fstream>
using namespace std;
int main()
{
int m_menuvalue;
const char SIZE=20;
cout << "1. Manage Books\n";
cout << "2. Manage Magazines\n";
cout << "3. Manage Audio Tapes\n";
cout << "4. Manage CDs\n";
cout << "5. Manage Videos\n";
cout << "6. Check Out Items\n";
cout << "7. Check In Items\n";
cout << "8. Search Inventory\n";
cout << "9. Exit the system\n\n";
cout << "Please select a menu option by typing the corresponding number.\n\n";
cin >> m_menuvalue;
if ( m_menuvalue == 1 ){
system("cls");
cout<<"1. Add\n";
cout<<"2. Edit\n";
cout<<"3. Delete\n";
cout<<"4. Search\n";
cout<<"5. Return to the Main Menu\n";
cout<<"Select an option: ";
int bookChoice;
char bookName[SIZE], authorName[SIZE], isbnNumber[SIZE],publishYear[SIZE], bookNumber[SIZE];
ofstream bookFile;
bookFile.open("bookfile.txt");
assert (!bookFile.fail( ));
cin>>bookChoice;
/***************************
* Add *
***************************/
if ( bookChoice == 1 ){
cin.ignore(130,'\n');
system("cls");
cout<<"Please enter book number.\n";
cin.getline (bookNumber,SIZE);
cout<<"Please enter book name?\n";
cin.getline (bookName,SIZE);
cout<<"Please enter book author's name?\n";
cin.getline (authorName,SIZE);
cout<<"Please enter book ISBN#?\n";
cin.getline (isbnNumber,SIZE);
cout<<"Please enter book publish year? ex.(20xx)\n";
cin.getline (publishYear,SIZE);
bookFile<<bookNumber<<endl;
bookFile<<bookName<<endl; //send to file
bookFile<<authorName<<endl;
bookFile<<isbnNumber<<endl;
bookFile<<publishYear<<endl<<endl;
cout<< "The information has been saved to our Archives\n\n";
bookFile.close( ); //close file
assert(!bookFile.fail( ));
}
/***************************
* Edit *
***************************/
if (bookChoice == 2){
ifstream readbookFile("readbookfile.txt");
cin.ignore(80,'\n');
readbookFile.getline(bookNumber,SIZE);
readbookFile.getline(bookName,SIZE);
cout<< "\n\n";
cout<< "Please select the book that you would like to edit.\n";
cin>>bookNumber;
if (bookNumber == '1'){
cin.ignore(80,'\n');
system("cls");
cout<<bookName<<endl<<authorName<<endl
<<isbnNumber<<endl<<publishYear<<endl<<endl;
readbookFile.close();
ofstream bookFile;
bookFile.open("bookFile.txt");
cout<<"Hit (ENTER), then enter the following book information.\n\n";
cin.ignore(80,'\n');
cout<<"Book name:\n";
cin.getline (bookName,SIZE);
cout<<"Author's name:\n";
cin.getline (authorName,SIZE);
cout<<"Book's ISBN#:\n";
cin.getline (isbnNumber,SIZE);
cout<<"Publish year: ex.(20xx)\n";
cin.getline (publishYear,SIZE);
bookFile<<bookName<<endl;
bookFile<<authorName<<endl;
bookFile<<isbnNumber<<endl;
bookFile<<publishYear<<endl<<endl;
cout<< "The information has been saved to our Archives\n\n";
bookFile.close( );
}
}