void the_name()
{
char name[80], address[80], city[80];
string state;
int zip, phone;
cout << "Mr. Smith wants to know your name: ";
cin.ignore(80, '\n');
cin.getline(name, 80);
cout << "In what city can Mr. Smith find you in:";
cin.ignore(80, '\n');
cin.getline(city, 80);
cout << "What zip should Mr. Smith put on a letter to you: ";
cin>>zip;
cout << "Mr. Smith has your zip, now he needs your address: ";
cin.ignore(80, '\n');
cin.getline(address, 80);
cout << "How about your state now for Mr. Smith:(Initials Please) ";
cin>>state;
cout << "Mr. Smith wants to prank call you, provide your digits: ";
cin>>phone;
cout<<" "<<endl<<endl;
cout<<"Thank you for providing me, I mean, Mr. Smith with the following information:"<<endl;
cout<<"*****************************************************************************"<<endl;
cout<<"** Name: "<<name<< "**"<<endl;
cout<<"** City: "<<city<< "**"<<endl;
cout<<"** State: "<<state<<" **"<<endl;
cout<<"** Zip Code:"<<zip<<" **"<<endl;
cout<<"** Address:"<<address<<" **"<<endl;
cout<<"** Phone Number:"<<phone<<" **"<<endl;
cout<<"*****************************************************************************"<<endl;
}
it all works EXCEPT for city, after entering a city, you have to hit enter twice then the code will continue, and no matter what you enter for a city name, nothing will be printed. everything else works. any ideas?