Hi guys, I'm just wondering on something maybe it's simple but I miss understanding it because my preconviend idea are fault.
The recursive is something that we call the same function with smaller problem, my question is lets assume I have a function called draw(int arr[], left delimiter, right delimiter) , and I have an array of size 10 which is int arr[10]= {1,3,2,1,1,1,1,1,1,1}, I called inside the function draw() the function itself but with parameters draw(arr, 0, 2)
so now after called that function, I get new stack frame with parameters (arr, 0 ,2) so my new array inside the second call of that function is {1,1,1} , in that case if I write arr[3], what will be shown? a trash value? or just the value of the arr that I was having in the caller function(the primarily one) ? thanks in advance.
The recursive is something that we call the same function with smaller problem, my question is lets assume I have a function called draw(int arr[], left delimiter, right delimiter) , and I have an array of size 10 which is int arr[10]= {1,3,2,1,1,1,1,1,1,1}, I called inside the function draw() the function itself but with parameters draw(arr, 0, 2)
so now after called that function, I get new stack frame with parameters (arr, 0 ,2) so my new array inside the second call of that function is {1,1,1} , in that case if I write arr[3], what will be shown? a trash value? or just the value of the arr that I was having in the caller function(the primarily one) ? thanks in advance.