Electrical and Computer Engineering
1 of 30
UAH
CPE 112
Parameters
•When a function is executed, it uses the arguments given to it in the function call.
•C++ supports two kinds of parameters
–Value parameters - the function receives a copy of the argument’s value
–Reference parameters (& after data type) - the function receives the memory address of the caller’s argument
•Examples:
• void Example (int& param1,    // reference
• int  param2,    // value
•       float param3 )  // value
•