Академический Документы
Профессиональный Документы
Культура Документы
Reference Parameters
This section introduces reference
parametersthe first of two means that
C++ provides for performing pass-by-
reference.
With pass-by-reference, the caller gives the
called function the ability to access the
callers data directly, and to modify that data
if the called function chooses to do so.
Overloaded Operators
In Chapter 19, we discuss how to overload operators to de-
fine how they operate on objects of user-defined data types.
(In fact, weve been using overloaded operators, including the
stream insertion operator << and the stream extraction
operator >>, each of which is overloaded to be able to display
data of all the fundamental types.
We say more about overloading << and >> to be able to
handle objects of user-defined types in Chapter 19.)
Section 15.12 introduces function templates for automatically
generating overloaded functions that perform identical tasks
on data of different types.
Function inputVector
Lines 2829 pass integers1 and integers2 to
function inputVector (lines 105109) to read
values for each vectors elements from the
user.
The function uses square brackets ([]) to
form lvalues that are used to store the input
values in each vector element.
Those who design systems use the language (in the form
of diagrams) to model their systems, as we do
throughout the C++ section of this book.
An attractive feature of the UML is its flexibility.
The UML is extensible (i.e., capable of being enhanced
with new features) and is independent of any particular
OOAD process.
UML modelers are free to use various processes in
designing systems, but all developers can now express
their designs with one standard set of graphical
notations.
For more information, visit our UML Resource Center at
www.deitel.com/UML/.