In pass by value a new address space is used for parameter in a function that have the exact same value as the argument.

Drawing 2025-01-15 12.07.03.excalidraw

⚠ Switch to EXCALIDRAW VIEW in the MORE OPTIONS menu of this document. ⚠

Text Elements

0x2829

20

0x282a

20

variable in main

variable in function

Link to original
Functions are given a copy of a value. This means it cannot alter the original value.