|
-
Nov 26th, 2002, 04:51 PM
#1
Thread Starter
Member
An object's data type
Don't know if what I'm about to say will make sense, so bear with me and ask if you don't understand...
When you have a class, in this case an 'Multiplier' class, how can you using the object identifier to return a value?
Example:
{
____Mulitiplier Multi;
____Multi.Number1=2;
____Multi.Number2=4;
____cout << Multi; *
}
This would return 8. I realise it's a useless class, but I'm more concerned about the * line. How could I make this line print the value '8' without having to use a line akin to "cout << Multi.result;"?
Does it have anything to do with class operators?
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
|