![]() |
|
#1
|
|||
|
|||
Need help with classes and overloadingOk...I'm totally fried. I pretty much finished my program, minus 1 small class that I'm having trouble trying to figure out how to implement it (Money::percent) near the bottom of the code.
CPP / C++ / C Code:
|
|||
|
#2
|
|||
|
|||
Re: Need help with classes and overloadingFrom what I can see, the variable amount1 is not known to class Money. It is an instance of class Money whose scope is in main(). I think what you want is this:
CPP / C++ / C Code:
|
|
#3
|
|||
|
|||
Re: Need help with classes and overloadingyes thank you
return ((all_cents*(percent_figure/100))/100); so that i could have it in decimal form. i was overcomplicating the program by trying to do random things that weren't needed. |
|
#4
|
|||
|
|||
Re: Need help with classes and overloadingIf you do that, you need to change the data type to float/double because any calculation that results between 0 and 1 (not including 1) as an integer will be 0.
|
|
#5
|
|||
|
|||
Re: Need help with classes and overloadingWhat problem are you actually having ?
|
|
#6
|
|||
|
|||
Re: Need help with classes and overloadingQuote:
yea i added: CPP / C++ / C Code:
|
|
#7
|
|||
|
|||
Re: Need help with classes and overloadingQuote:
|
Recent GIDBlog
Problems with the Navy (Chiefs) by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Need Help/Corrections in Classes & Operators Overloading | MKQ | C++ Forum | 3 | 29-Jan-2008 09:03 |
| overloading normal & virtual functions | balusss | C++ Forum | 5 | 25-Aug-2007 10:39 |
| What's good to implement operator overloading with 'friend'? | meili100 | C++ Forum | 2 | 22-Jul-2007 08:34 |
| Overloading operator = in a managed class | Gix | .NET Forum | 5 | 26-Nov-2006 05:34 |
| A Comprehensive Digest of C++ | mithunjacob | C++ Forum | 39 | 20-Jun-2004 20:09 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The