Answers

Question and Answer:

  Home  Programming Concepts

⟩ A function is running, it has its own stack pointer, memory area now it invokes another function from this point what changes will be in its memory area and what other changes in data segment, stack segment, heap segment. I want a complete picture of memory architecture?

There will be a lot of changes in fact. First of all, all the variables the function was suing needs to be pushed into the stack. (we need all these variables when we return from the other function). The Program counter will be pushed to stack too... (When the "return" of second function occurs we should know where to 'return' to)These are the basics which are bound to happen when a function calls another.

 127 views

More Questions for you: