cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
Beginners
scoping issues?
scoping issues?
Oct 11, 2017 at 12:41am UTC
king11232
(1)
What's wrong with my code?
When I try the deposit/withdrawal function. the balance won't update accordingly. Similar to delete_acct function, it doesn't delete the account I want.
https://github.com/Flipppzw/hw
Oct 11, 2017 at 6:27am UTC
coder777
(8443)
The problem is that getAccount(index) returns a copy of the object.
Here you change the copy not the original:
bank.getAccount(index).makeDeposit(amount);
Topic archived. No new replies allowed.