← C Programming learning pathC Programming · Module 5 of 10
Functions
Split programs into functions with parameters, return values and prototypes.
📖 Key ideas
- A function has a return type, name and parameters: int add(int a, int b).
- Declare a prototype before main if the function is defined later.
- C passes arguments by value: the function gets copies.
- void means the function returns nothing.
- Recursion: a function that calls itself with a base case.
💡 Real-life example: A function is a kitchen helper: give ingredients (arguments), get back a dish (return value).
PrototypeFunction declaration before use
voidReturns nothing
Pass by valueFunction receives copies of arguments
RecursionFunction calling itself