CISC 1600 Lecture Notes - Lecture 18: Polskie Radio Program I, Function Prototype

41 views5 pages

Document Summary

Passing data to parameters by value : a copy of the actual parameter is placed in the memory location of its corresponding formal parameter. Pass by reference : both the main function and function called refer to the same memory location (share the same value). Argument passed to reference parameter must be a variable (cannot be an expression or constant) Use only when appropriate, try to stay away from using it. When a copy of an argument cannot reasonably or correctly be made, such as when the argument is an array or a file stream object. If a value must be sent back to the calling function (or can use a return statement instead) When two or more variables passed as arguments to a function need to have their values changed by that function. Ex) void calpaycheck(float rate, int time, float& gross) // 3 parameters.

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Documents

Related Questions