CMP Ch.6 - Answers to Review Questions Chapter 6 1 Because...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
Answers to Review Questions Chapter 6 1. Because they are created in memory when the function begins execution, and are destroyed when the function ends. 2. An argument is a value passed to a function. A parameter variable is a variable local to the function which receives the argument. That is to say, the argument's value is copied into the parameter variable. 3. Inside the parentheses of a function header. 4. If the argument is passed by value, nothing needs to be done. The function cannot access the argument. If the argument is passed by reference, the parameter should be defined with the const key word. 5. Yes. The first argument is passed into the parameter variable that appears first inside the function header's parentheses. Likewise, the second argument is passed into the second parameter, and so on. 6. With the return statement. For example, the following statement returns the value in the variable x . return x;
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 04/03/2010 for the course CMPSC 121 taught by Professor Crawford,georgew during the Spring '07 term at Penn State.

Page1 / 3

CMP Ch.6 - Answers to Review Questions Chapter 6 1 Because...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online