CIS 3142 Lecture Parameter Transmission

CISC 3142
Programming Paradigms in C++
Parameter Transmission

Parameter Transmission

Practical Rules for Parameter Transmission

Call-By-Reference — Modified Parameter is to be Passed Back to Argument

Call-By_Const_Reference — Avoiding the Argument-to-Parameter Copy

Call-By-Value

const Member Function — Preventing the Receiver (*this) From Being Modified

Return Value Transmission

Practical Rules for Transmitting Return Values

Return-by-Value

Return-by-Reference

Return-by-Const-Reference

One Final Note — Passing-By-Pointer

In C, one achieved the effect of modifying the argument by passing a pointer to the object to be changed (rather than the object itself).

Code Used in this Lecture