-
June 28th, 2009, 05:45 PM
#1
return statemens in member functions
I'm a noob just getting into classes in VC++ (2008). I've seen a lot of examples where one member function will call another, and the called member function will have nothing but a return statement. Here's the latest example I was looking at:
__________________________
-within the class "BankAccount":
public:
double get_balance();
private:
double balance;
_________________________
-never mentioned in driver file!
____________________________
-in implementation file:
double BankAccount::get_balance()
{
return balance;
}
____________________________
Is this a formality? Planning for later? Or does it actually set a value somewhere?
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|