Run Code  | API  | Code Wall  | Misc  | Feedback  | Login  | Theme  | Privacy  | Patreon 

Recursive Function Calling Example with Stack Addresses

Language: Layout:
+ ] Compiler args + ] Show input
Compilation time: 0.62 sec, absolute running time: 0.14 sec, cpu time: 0 sec, memory peak: 3 Mb, absolute service time: 0,77 sec 
edit mode |  history  | discussion
Test Program
Pointer size is 8 bytes, int size is 4 bytes
Address of const value is 0x7ffd3074776c
Calling recursiveAdd: i = 5 Address of iPtr = 0x1e48010
Calling recursiveAdd: n = 5 Address of n = 0x7ffd3074773c Address of return = 0x7ffd30747738
Calling recursiveAdd: n = 4 Address of n = 0x7ffd3074770c Address of return = 0x7ffd30747708
Calling recursiveAdd: n = 3 Address of n = 0x7ffd307476dc Address of return = 0x7ffd307476d8
Calling recursiveAdd: n = 2 Address of n = 0x7ffd307476ac Address of return = 0x7ffd307476a8
Calling recursiveAdd: n = 1 Address of n = 0x7ffd3074767c Address of return = 0x7ffd30747678
Triangle sum of 5 = 15
Calling recursiveAdd: j = 5 Address of jPtr = 0x1e48030
Calling recursiveAdd: n = 5 Address of n = 0x7ffd3074773c Address of return = 0x7ffd30747738
Calling recursiveAdd: n = 4 Address of n = 0x7ffd3074770c Address of return = 0x7ffd30747708
Calling recursiveAdd: n = 3 Address of n = 0x7ffd307476dc Address of return = 0x7ffd307476d8
Calling recursiveAdd: n = 2 Address of n = 0x7ffd307476ac Address of return = 0x7ffd307476a8
Calling recursiveAdd: n = 1 Address of n = 0x7ffd3074767c Address of return = 0x7ffd30747678
Triangle sum of 5 = 15

    
                
λ
.NET NoSQL database for rapid development