CSC 160 - Chapter 6 Quick Reference
Chapter 6 "Functions"
This chapter covers the basics of C++ functions.
General Terms
function |
function body |
void |
return |
arguments |
parameters |
formal arguments |
scope |
function call |
function header |
function prototype |
|
pass-by-value |
pass-by-reference |
default arguments |
|
local variable |
global variable |
static local variable |
|
overloading |
exit() |
stub |
driver |
Concepts
Important concepts covered include:
- Defining a function:
- Name
- Return type
- Parameter list
- Body
- The three components of using a function:
- Calling a function,
- Defining the function header and body, and
- Defining the function prototype
- Defining function parameters and calling the function with the
appropriate arguments
- Understanding return values and void functions that don't return
anything
- Know the difference between pass-by-value and pass-by-reference
function parameters, know when to use each method
- Know the scope of variables in a function: parameter, local
variables and global variables
- Global variables are initialized to zero by default
- Understand the impact of making a local variable static
- Know how to specify default arguments to a function... how are
default used in a function call
- Know what function overloading is
- Understand how stubs and drivers are used while you are building
your program
Disclaimer: The goal of this "cheat sheet" is to review
the more important concepts in the chapter. The exclusion of any
material in the chapter from this "cheat sheet" does not mean
that you are not responsible for that material.