Sign In | Subscribe
Start learning today, and be successful in your academic & professional career. Start Today!
Loading video...
This is a quick preview of the lesson. For full access, please Log In or Sign up.
For more information, please see full course syllabus of Introduction to C++
  • Discussion

  • Study Guides

  • Download Lecture Slides

  • Table of Contents

  • Related Services

Bookmark and Share

Start Learning Now

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

Sign up for

Membership Overview

  • Unlimited access to our entire library of courses.
  • Search and jump to exactly what you want to learn.
  • *Ask questions and get answers from the community and our teachers!
  • Practice questions with step-by-step solutions.
  • Download lesson files for programming and software training practice.
  • Track your course viewing progress.
  • Download lecture slides for taking notes.
  • Learn at your own pace... anytime, anywhere!

Functions, Part 1

  • Functions increase readability and maintainability by allowing the programmer to divide the work into smaller, easily understood modules.
  • Each function must have a prototype that describes the function interface, including its return value and parameter types. The compiler uses this to verify correct usage.
  • Each function must have a definition that contains the work performed by the function. Its interface must match the prototype.
  • The function is used when code calls the function, providing an argument for each parameter, and uses the result
  • The function returns a single value and can be used anywhere an expression value is used
  • Here are links to more information about C++ functions:

Functions, Part 1

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.

  • Intro 0:00
  • Overview 0:09
  • Value of Functions 0:46
  • Example Without Function 2:04
  • Example With Function 3:30
  • Function Prototype 4:11
    • Return Type
    • Name
    • Parameters
    • Nomenclature
  • Prototype Example 5:45
  • Function Definition 6:28
  • Definition Example 8:11
  • Function Parameter Types 8:52
    • Definition
  • Using the Function 11:09
  • Functions Return Single Value 13:15
  • Break Problem into Pieces 14:12