Lessons
Topics covered
- Purpose and benefits of functions
- Function definition syntax: return type, name, parameters, body
- void functions vs value-returning functions
Topics covered
- How to call a function from main() or another function
- Passing arguments and receiving return values
- The call stack and execution flow
Topics covered
- What a function prototype is and why it is needed
- Declaring prototypes before main()
- Forward declarations and compilation order
Topics covered
- Pass by value
- Parameters vs arguments
- Multiple parameters and data types
Topics covered
- The return statement
- Return types and type matching
- Using returned values in expressions
Topics covered
- Scope of local variables
- Global variables and their risks
- Variable shadowing
Topics covered
- The static keyword for local variables
- Persistence of static variables across function calls
- Default argument values in function definitions
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