Parameter Passing (Value vs Pointer) & Tail Recursion
“Call-by-value semantics, simulating call-by-reference via pointers, and tail call elimination.”
1.Parameter Passing Semantics: Pure Call-by-Value
§ 3.1.C strictly supports Call-by-Value ONLY:
- When an argument is passed to a function, the function receives a copy of the value.
- Modifying a parameter inside the function has zero effect on the caller's original variable.
Simulating Call-by-Reference:
- To modify caller variables, pass the memory address of the variable (pointer).
- Even then, the pointer itself is passed by value (a copy of the address is pushed onto the stack)!
Primary Academic References & Exam Sources
Every concept in Notes From a B.Tech Brain is synthesized from authoritative academic texts, seminal peer-reviewed research, verified exam archives, and renowned university lectures.
Curated for clarity, rigorous numerical solving, and semester excellence:
Systematic beginner-to-advanced C with clear examples.
Clear step-by-step C explanations — great for semester lab preparation.