I am getting this error Compiler Output:
0IGzNLUq.c: In constructor 'CheckingAccount::CheckingAccount(int, float, float)':
0IGzNLUq.c:104: error: invalid use of member (did you forget the '&' ?)
and I have tried about 100 times to fix it and google how to fix it and I have no clue... Can someone see what I am missing?
Also I know I have 4 unused variables but I have not wrote the main yet to put them in I wanted to get this straight first. Thank you very much.
Okay, but I have changed it a lot in the scope to try to get it to read AccountNum like it did for Charge and balance by using (float), char... a couple others that I knew weren't going to work like int, double, double amount.... So how do I properly declare it?
I want it to read setAccountNumber = AccountNum
or do I not need to set an account number if I made AccoutNum = 65432?
Is setAccountNumber used if I was asking someone to set an account number?
The directions just say to set the account number not to ask the user to do so... See I'm starting to get myself confused...
>setAccountNumber is a function. You can't add an integer to a function - >that's not valid C++.
sure you can. you can also make a function an lvalue in an assignment expression. ie f() = 10
@DTSCode: the issue is the missing argument list. Without the argument list, you refer to the function, rather than calling it and referring to its return value.
i know. that was the only thing i had read and would like to correct him
But your correction was not correct. You may not add a value to a function. You may add a value to something a function returns, provided it returns something for which that would make sense.
setAccountNumber function is declared as a const function which is peculiar. Normally a function with that kind of name is expected to change something. I would expect an account number attribute with declarations like this.
1 2 3 4 5 6 7 8 9
// Of course your account number type could also be a string or double or whatever you wish to design
void setAccountNumber(int value);
int getAccountNumber() const; // use const for accessors, but not mutators
int accountNumber;
// to invoke (very generic code - you'd substitute your actual type and function names)
AccountType account;
account.setAccountNumber(value); // write the value into the object so it cannot be const function
int number = account.getAccountNumber(); // guaranteed not to change the object because it is const function