//Sometimes the getLine works and at other times it does not work.
void directory::enterTheDetails()
{
clrscr();
newDataLogo();
gotoxy(30,10);
char ch;
cout<<" \n Please enter the first name of the new contact : ";
cin>>contactFirstName;
ch = cin.get();
cout<<" \n Please enter the last name of the new contact : ";
cin>>contactLastName;
ch = cin.get();
cout<<" \n Please enter the Home Address of the new contact : ";
cin.getline(homeAddress,50,'\n');
cout<<" \n Please enter the email address of the new contact. : ";
cin.getline(email,25,'\n');
cout<<" \n Please enter Land line Phone Number of the new contact: ";
cin>>landLinePhone;
ch = cin.get();
cout<<" \n Please enter Cellular Phone Number of the new contact: ";
cin>>cellularPhone;
ch=cin.get();
}
|