phone application

// error msg: expexted primary-expression
int main(int argc, char** argv)
{ // open main
string nm;
string np;
string msg;
int gid, choice, choice2, choose;
string x,y;
PhoneBook pb;

showMenu();
cin>>choose;

if(choose == 1){{ // open if

do
{ //open do
cout << "\n\n\n\t\t============================\n\t";
cout << "\t\t\t\t ";
cout << "\n\t\t 1. ADD NEW CONTACT \n\t";
cout << "\t\t\t\t ";
cout << "\n\t\t 2. SEARCH CONTACT \n\t";
cout << "\t\t\t\t ";
cout << "\n\t\t 3. DELETE CONTACT \n\t";
cout << "\t\t\t\t ";
cout << "\n\t\t 4. DISPLAY ALL CONTACTS \n\t";
cout << "\t\t\t\t ";
cout << "\n\t\t 5. EXIT TO MENU \n\t";
cout << "\t\t\t\t ";
cout << "\n\t\t============================";
cout << "\n\n\n\tENTER OPTION : ";
cin >> choice;

switch(choice)
{ // open switch
case 1:
cout << "\n\tNAME : ";
cin.ignore();
getline(cin, nm);
cout << "\tPHONE NO : ";
cin >> np;
cout << "\tGROUPID : ";
cin >> gid;
pb.InsertContactInfo(nm,np,gid);
cout << "\n\t\t" << nm << " HAS BEEN ADDED TO YOUR CONTACTS.";
break;

case 2:
cout << "\n\tSEARCH BY NAME : ";
cin.ignore();
getline(cin, nm);
pb.searchContactInfo(nm);
break;

case 3:
cout<< "\tDELETE BY NAME : ";
cin >> x;

pb.deleteNode(x);
break;

case 4:
cout << "\n\n\t\tLIST OF CONTACTS";
cout << "\n\t\t================\n";
pb.displayContactInfo();
break;

case 5:
showMenu();
break;


default:
cout<<"\n\nERROR. CHOOSE ONLY THE GIVEN OPTION. RE-ENTER : ";}
} // close switch

while (choice !=5); //close do

} // close if #1

else if (choose == 2){ // open if else

do
{ // open do
cout << "\n\n\n\t\t============================\n\t";
cout << "\t\t\t\t ";
cout << "\n\t\t 1. CREATE NEW MESSAGE \n\t";
cout << "\t\t\t\t ";
cout << "\n\t\t 2. SEARCH MESSAGE \n\t";
cout << "\t\t\t\t ";
cout << "\n\t\t 3. DELETE MESSAGE \n\t";
cout << "\t\t\t\t ";
cout << "\n\t\t 4. DISPLAY MESSAGE \n\t";
cout << "\t\t\t\t ";
cout << "\n\t\t 5. EXIT TO MENU \n\t";
cout << "\t\t\t\t ";
cout << "\n\t\t============================";
cout << "\n\n\n\tENTER OPTION : ";
cin >> choice2;

switch(choice2)
{ // open switch
case 1:
cout << "\n\tNAME : ";
cin.ignore();
getline(cin, nm);
cout << "\tPHONE NO : ";
cin >> np;
cout << "\tMESSAGE : ";
cin >> msg;
pb.insertMsg(string nm, string np, string msg);
cout << "\n\t\t" << nm << " MESSAGE SENT ! ";
break;

case 2:
cout << "\n\tSEARCH BY NAME : ";
cin.ignore();
getline(cin, nm);
pb.searchMsg(string nm);
break;

case 3:
cout<< "\tDELETE BY NAME : ";
cin >> y;

pb.deleteMsg(y);
break;

case 4:
cout << "\n\n\t\tLIST OF MESSAGES";
cout << "\n\t\t================\n";
pb.displayMsg();
break;

case 5:
showMenu();
break;


default:
cout<<"\n\nERROR. CHOOSE ONLY THE GIVEN OPTION. RE-ENTER : ";}
} // close switch

while (choice2 !=5); //close do


} // close if #2

else if (choose ==3 ){
system ("PAUSE");
return 0;
}

else{
cout<<"\n\nINVALID INPUT. CHOOSE ONLY THE GIVEN OPTION. RE-ENTER : ";

}
}


return 0;
}

[/code]
in function showMenu has 3 option.. 1 for contact info, 2 for message, and 3 for exit
Topic archived. No new replies allowed.