void Record::Update() {
string choice;
cout << "Enter ID: " << endl;
cin >> IDValue;
for(Itr = List.begin() ; Itr !=List.end() ; Itr+) {
if(Itr->GetID() == IDValue)
{
cout << Transit->GetID() << endl;
cout << "Would you like to set Name ? (y/n) :";
cin >> choice;
if ( choice == 'y' )
cin >> strName;
Itr->SetName(strName);
cout << Itr->GetName() << endl;
cout << Itr->GetLocation() << endl;
}
}
}
This function finds a record by its unique ID number. Each new record is given an ID number. If I enter in ID 2 the function displays the record with ID 2. How can I modify one of the attributes of the record? In this case the location of it.
1 Answer