Module 3 of 4

C++ Functions

8 lessons  ·  Function structure, scope, overloading

1

Introduction to Functions

Topics covered

  • Purpose and benefits of functions
  • Function definition syntax: return type, name, parameters, body
  • void functions vs value-returning functions
2

Calling a Function

Topics covered

  • How to call a function from main() or another function
  • Passing arguments and receiving return values
  • The call stack and execution flow
3

Function Prototypes

Topics covered

  • What a function prototype is and why it is needed
  • Declaring prototypes before main()
  • Forward declarations and compilation order
7

Static Local Variables and Default Arguments

Topics covered

  • The static keyword for local variables
  • Persistence of static variables across function calls
  • Default argument values in function definitions
8

Reference Variables and Function Overloading

Topics covered

  • Reference variables and pass by reference
  • Modifying arguments inside a function
  • Function overloading — same name, different parameters
  • How the compiler resolves overloaded calls