About the span array in the parameter

here the span array is passed by value to the function so when the fn call gets over and we are trying to print the span array in the main function how is the chng getting reflected there as the fn call got over?

Arrays by default are passed by reference. The array was created in the main. Then it was passed to the function by reference. So modifications done in the array inside the function will be reflected back in the original array which was created in main.

but in this qstn bhaiya have passed the reference by value?How does it get pass by reference ?

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.