c - stack function call problem -
I have a function called My main task is given below: I want to know the order of execution and what will happen before, during and after the function call of my stack first Your output will be 0, then 1, then 2, and then 0. What you are not seeing is an intermediate call, it is a complete output (before n & gt; part): fun1 () , which is used for recursive
I'm confused about the first call for fun (- n); What will it do and how will my stack pop up after each function ends?
zero fun (int n) {if (n> gt;) {fun (- n); Printf ("% d", n); Fun (- n); }}
int a; One = 3; Fun (a);
funny (n)
Before n fun Call & gt; 0; N = 3 n & gt; Funny call before 0; N = 2 n & gt; Funny call before 0; N = 1 n & gt; Funny call before 0; Fun Call Before N = 0 0 n & gt; 0; N = -1 1n> Funny call before 0; N = 0 2n & gt; Funny call before 0; N = 1 n & gt; Funny call before 0; Fun Call Before N = 0 0 n & gt; 0; N = -1
Comments
Post a Comment