Enter your Sign-on user name and password.

Forgot password?
  • Follow us on:
Loading video...

Start Learning Now

Our free lessons will get you started (Flash® 10 required).
Get immediate access to our entire library.

Sign up for Educator.com

Features Overview

  • Get on-demand access to our complete library
  • Search and jump to exactly what you need to learn
  • Track your progress
  • Download practice and lesson files
  • *Ask questions and get answers from our community & instructors

Functions, Part 2

  • A function may have “call by value” parameters, where the caller provides input arguments for the function to work on. The function is free to change the values of these parameters without affecting the caller. Where possible, this is the preferred method to increase isolation and maintainability.
  • A function may have “call by reference” parameters, where the caller expects the function to return new values for the input arguments.
  • A function may have “call by address” parameters, where the caller passes pointers as parameters.
  • A function may have default parameters that provide a default value for any argument not provided by the caller.
  • Each function usually has exactly one return value, or the caller’s “answer”, that will be used by the caller.
  • Functions may be overloaded which allows the same function name to be used with different prototypes.
  • Functions are crucial to creating modular code, avoiding code duplication, allowing more readable and reusable code. Readable code is easier to maintain. Reusable code saves time and effort. Modules should be insulated from their containing systems to decrease external dependencies, and increase reusability
  • Here are links to more information about C++ functions: http://www.cplusplus.com/doc/tutorial/functions/ http://www.cplusplus.com/doc/tutorial/functions2/

Functions, Part 2

Lecture Slides are screen-captured images of important points in the lecture. Students can download and print out these lecture slide images to do practice problems as well as take notes while watching the lecture.

Computer Science: Introduction to C++