One way to pass data from the stack to the heap is as an argument in a function call.
The parameter acts as the interface between stack and heap. In other words, the data in the variable and the data being passed into the function becomes independent of each other.
So even though a function resides in the heap, we are not pointing or passing by reference, we are actually cloning the data to be processed by the function, which is the same as passing by value (remember? like copying data into another variable or “adding”value).