Chapter 18. Operator Overloading

I l @ ve RuBoard

Overloaded, undermanned, meant to founder, we Euchred God Almighty's storm , bluffed the Eternal Sea!

”Kipling

C++ is very good at giving you the tools to organize and use information in a way that's most natural to you. Operator overloading is one of the features that facilitates this. It allows you to define functions to be called when ordinary C++ operators are used on the classes you've defined. For example, you can use operator overloading to tell C++ how to combine two boxes ( a_box + b_box ). (This assumes that you have a definition of what it means to add two boxes and that it makes sense to do so.) In this chapter we will go step by step through the creation of a fixed-point class and all the operators for it.

I l @ ve RuBoard


Practical C++ Programming
Practical C Programming, 3rd Edition
ISBN: 1565923065
EAN: 2147483647
Year: 2003
Pages: 364

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net