How does the execution stack change when a recursive function is called in C?
- A new thread is created
- Each function call adds a new stack frame
- The stack remains unchanged
- The stack shrinks
In C, when a recursive function is called, each function call adds a new stack frame to the execution stack. These stack frames store the local variables and return addresses for each function call. This process continues until the base case is reached.
Loading...
Related Quiz
- You're working on a program that continuously monitors sensor data and reacts when a certain threshold is reached. Which loop construct would be most suitable for this task?
- When working with binary files in C, what is the significance of the 'b' character in the mode string?
- In a two-dimensional array declared as int arr[5][10];, the expression arr[i][j] refers to the ________ element in memory.
- In a union, all members share the same ________.
- What is the purpose of using pointers to structures in C programming?