Abstract
Functions (Section 1.4, Chapter 3) are convenient tools to abstract behaviour and computation. E.g. once the function sqrt (double) has been properly defined, one does not need to remember how it computes its result in order to use it. Moreover, if one prefers an alternative algorithm for the computation of sqrt (double), it is easy to change just the function body of the definition, without disturbing the rest of the program’s code. One can say that the computation of sqrt (double) is encapsulated inside its definition which can be changed at will, as long as the specification of the function, i.e. its interface, remains the same.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
Author information
Authors and Affiliations
Rights and permissions
Copyright information
© 2001 Springer-Verlag London
About this chapter
Cite this chapter
Vermeir, D. (2001). User-Defined Types. In: Multi-Paradigm Programming using C++. Springer, London. https://doi.org/10.1007/978-1-4471-0311-0_4
Download citation
DOI: https://doi.org/10.1007/978-1-4471-0311-0_4
Publisher Name: Springer, London
Print ISBN: 978-1-85233-483-3
Online ISBN: 978-1-4471-0311-0
eBook Packages: Springer Book Archive