Original Post
Hiya all. Experiencing a few problems with my bank simulation program. Basically I have a manager, creates an array of Customers which each creates an array of Accounts. However only the array of Customers only really works and also a function such as the follow, called in Main, through the manager. Doesn't update anything, and if i used a cout to output 'fname' for example - i would get the right value. But when its out of the function, nothing has changed. At a loss please help. This is how its called in main.cpp.
void Customer::updatePersonDetails() {
string t_fname; string t_lname; string t_phone;
string t_dob; char t_sex;
cout << "\nUpdate Customer Details\n~~~~~~~~~~~~~~~~~~~~~~~~\n";
cout << "For fields you would like to leave unchanged - input '0'\n";
cout << "First Name: " << fname << "\t\tNew First Name: ";
cin >> t_fname;
if(t_fname != "0") { fname = t_fname; }
cout << "Surname: " << lname << "\t\t\tNew Surname: ";
cin >> t_lname;
if(t_lname != "0") lname = t_lname;
cout << "Phone: " << phone << "\t\tNew Phone: ";
cin >> t_phone;
if(t_phone != "0") phone = t_phone;
cout << "Sex: " << sex << "\t\t\t\tNew Sex: ";
cin >> t_sex;
if(t_sex != '0') sex = t_sex;
cout << "Date Of Birth: " << fname << "\t\tNew Date Of Birth: ";
cin >> t_dob;
if(t_dob != "0") dob = t_dob;
cout << "\n";
}
case 3:
cout << "Customer Account number: ";
cin >> custAcc;
if(mgr->search(custAcc) == -1) { cout << "Error: "; break; }
else {
mgr->getCust(mgr->search(custAcc)).updatePersonDetails();
}
break;