main: and remembered to delete the variable from heap ...
Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
This commit is contained in:
parent
c91b7ee785
commit
78660fb70e
1 changed files with 2 additions and 1 deletions
3
main.cpp
3
main.cpp
|
@ -34,11 +34,12 @@ Account* do_account() {
|
||||||
|
|
||||||
void scoped_account() {
|
void scoped_account() {
|
||||||
log_out("HERE");
|
log_out("HERE");
|
||||||
Account* account = do_account();
|
auto account = do_account();
|
||||||
log_out("HERE");
|
log_out("HERE");
|
||||||
account->withdraw(100);
|
account->withdraw(100);
|
||||||
log_out("Current Balance: " << account->getBalance());
|
log_out("Current Balance: " << account->getBalance());
|
||||||
log_err("dang");
|
log_err("dang");
|
||||||
|
delete account;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue