Syllabus

  1. 01FunctionsPackage code into reusable functions. Define and call them, pass parameters by value, return results, and learn what the compiler converts silently on the way in and out.4 lessons
    1. 01Defining and Calling Functions
    2. 02Parameters and Return Values
    3. 03Silent Conversions and Missing Returns
    4. 04Quiz: Functions
  2. 02Declarations, Headers and ScopeDeclare functions before they are defined, split a program across header and source files, guard headers against double inclusion, define small functions in headers with inline, and keep names in the right scope.5 lessons
    1. 01Declarations and Definitions
    2. 02Header Files and Include Guards
    3. 03Inline Functions and the One Definition Rule
    4. 04Scope
    5. 05Quiz: Declarations, Headers and Scope
  3. 03Flexible FunctionsMake one function name do more: default arguments, overloading with its resolution and ambiguity rules, and function templates that work for any type.4 lessons
    1. 01Default Arguments
    2. 02Function Overloading
    3. 03Function Templates
    4. 04Quiz: Flexible Functions
  4. 04PracticeSharpen your function-writing skills with short code challenges, then combine several functions into a unit-converter project.3 lessons
    1. 01Function Code Challenges
    2. 02Project: Unit Converter Toolkit
    3. 03Quiz: Writing Functions