Hi Everyone, I'm having a bit of trouble understanding what is happening with my program when i'm running it.
problem: When it runs it asks for each entry one by one until it gets to the street address, where is actually skips it as so --> "Street Address: City:"
. here is the code to my build function which is apart of my "addressBook" class.
void addressBook::buildList()
{
string val;
cout << "Enter In a list of Contacts/Addresses for the Address Book-- to stop the program enter in -999." << endl;
nodeType *newNode;
while(val != "-999")
{
newNode = new nodeType;
cout << "First and Last Name: ";
cin >> newNode->fname >> newNode->lname;
cout << "Street Address: ";
getline(cin, newNode->address); //<--- Here is the issue
cout << "City: ";
cin >> newNode->city;
cout << "State: ";
cin >> newNode->state;
cout << "Zip Code : ";
cin >> newNode->Zip;
newNode->link = NULL;
if(first == NULL)
{
first = newNode;
last = newNode;
count++;
}
else
{
last->link = newNode;
last = newNode;
}