- #1
ghost305
- 14
- 0
Help with STL container list for INformation Manager!
I'm trying to create a info manager like rolodex.
Rolodex.cpp
List() function
Add() function
private member in rolodex class:
list <Rolocard> sCard;
---------------------------------------------------------
what is the issue with this code?
I'm trying to create a info manager like rolodex.
Rolodex.cpp
List() function
Code:
void Rolodex::List()
{
list<string>::iterator cIterator;
for (cIterator = cardlist.begin(); cIterator != cardlist.end(); ++cIterator)
{
cout << *cIterator << endl; //outputs its contents
}
}//end List Function
Add() function
Code:
void Rolodex::Add(list<Rolocard>& cardlist)
{
string first, last, add, occ, phone;
cout << "Creating new Card "<< endl;
cout << "----------------------"<<endl;
cout << "Enter First Name: " << endl;
cin >> first;
cout << "Enter Last Name: "<< endl;
cin >> last;
cout << "Enter Address: "<< endl;
cin >> add;
cout << "Enter Occupation: " << endl;
cin >> occ;
cout << "Enter Phone Number: " << endl;
cin >> phone;
Rolocard newcard(first, last, add, occ, phone);
cardlist.push_back(newcard);
}
private member in rolodex class:
list <Rolocard> sCard;
---------------------------------------------------------
what is the issue with this code?