The following sections of this BookRags Literature Study Guide is offprint from Gale's For Students Series: Presenting Analysis, Context, and Criticism on Commonly Studied Works: Introduction, Author Biography, Plot Summary, Characters, Themes, Style, Historical Context, Critical Overview, Criticism and Critical Essays, Media Adaptations, Topics for Further Study, Compare & Contrast, What Do I Read Next?, For Further Study, and Sources.
(c)1998-2002; (c)2002 by Gale. Gale is an imprint of The Gale Group, Inc., a division of Thomson Learning, Inc. Gale and Design and Thomson Learning are trademarks used herein under license.
The following sections, if they exist, are offprint from Beacham's Encyclopedia of Popular Fiction: "Social Concerns", "Thematic Overview", "Techniques", "Literary Precedents", "Key Questions", "Related Titles", "Adaptations", "Related Web Sites". (c)1994-2005, by Walton Beacham.
The following sections, if they exist, are offprint from Beacham's Guide to Literature for Young Adults: "About the Author", "Overview", "Setting", "Literary Qualities", "Social Sensitivity", "Topics for Discussion", "Ideas for Reports and Papers". (c)1994-2005, by Walton Beacham.
All other sections in this Literature Study Guide are owned and copyrighted by BookRags, Inc.
A constant reference parameter is a term relevant to computer programming. The parameter allows a programmer to protect the data that has been sent to a function, so that the function cannot alter the data. This is possible because it is the address of the data that is actually sent to the function, not a copy of the data itself. When the function is executed, the data at the supplied address is used.
The preservation of data can also be achieved by the use of a so-called value mechanism. However, this latter mechanism requires more memory than does the use of a constant reference parameter, because it requires data to be copied. Since the constant reference parameter operates by supplying the address of data, not the data itself, less memory is required.
A constant reference parameter operates by the use of the modifier "const" in the encoded function definition. For example, the following function definition is a reference parameter, which can alter the value of the data it is commanded to obtain: void GetData (double &Num3, int &Num4). Any change made to the values referred to by the parameter nametags is also a change in the value referred to by the any arguments that are written. This is because the parameter and argument are directed to the same location in memory. In contrast, the function definition of a constant reference parameter would be written as: void GetDouble (double &Num3, const int &Num4). The use of the "const" designation has modified the function so that the data cannot be changed, by allowing the parameter and the argument to have the same memory location.
Constant reference parameters are utilized with programming components, primarily for structured object such as structs, classes, and arrays. Object-oriented languages such as C++ utilize constant reference parameters.