How does stack look in function calls? Write a recursive function call, how will the stack look like?



How does stack look in function calls? Write a recursive function call, how will the stack look like..

Answer / Rahul Pal

In a recursive function call, each new call creates a new frame on the stack. The new frame contains the return address of the current function (which points to the next instruction after the return statement), local variables, and parameters. As the recursion deepens, more frames are pushed onto the stack. If the recursion is too deep, it can cause stack overflow.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More C++ Interview Questions

What are string library functions(syntax).

1 Answers   Accenture,


How will you execute a stack using a priority queue? (Push and pop should be in O (1)).

1 Answers   Adobe,


What are "pure virtual" functions?

1 Answers   Adobe, Alter, iNautix,


Discuss the role of C++ shorthands.

1 Answers   Adobe,


In C++ what is the meaning of data hiding?

1 Answers   Aricent,


Explain the difference between method overriding and method overloading in C++?

1 Answers   Accenture,


what is friend function in C++?

1 Answers   TCS,


Write a C++ Program to Find Sum and Average of three numbers.

1 Answers  


What are the advantages and disadvantages of B-star trees over Binary trees?

1 Answers  


What is meant by exit controlled loop?

1 Answers   Adobe,


Define type casting in C++.

1 Answers   Amdocs,


What is the difference between an ARRAY and a LIST in C++?

2 Answers   IBS, TCS,


Categories