summary08 - • Main is an integer function that returns an...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
Formal parameter - listed in function declaration and used as placeholder in function definition Argument – something used to fill in a formal parameter. Call-by-value - only the value of an argument is used Call-by-reference – the variable is substituted for the formal parameter Summary Ch 4.1 – 4.2 Chapter 4.1 Void Functions Void functions can be used as displays or to call other functions Void- returns no value, no return statement Can have a void function without any arguments Return statements in void functions are optional – halts execution of function
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: • Main is an integer function that returns an integer Chapter 4.2 Call-By-Reference Parameters • Call-by-reference substitutes a variable (not its value) for the formal parameter • Want to differentiate between formal parameters and variables in main part of program • can mix call-by-value and call-by-reference parameters in function declaration by using (&) for reference • make sure you do not omit the & when writing a function...
View Full Document

This note was uploaded on 08/26/2009 for the course CS 140 taught by Professor Staff during the Fall '08 term at Southern Illinois University Edwardsville.

Ask a homework question - tutors are online