We didn’t return the updated array from selection_sort but still, we’re able to access the updated array. How is it done?
Access updated array
@sachinjangid We are passing the pointer to the array which means that we are working on the same array, thats why the changes made in function were reflected on the array being passed.
@keshavgupta0103 but in the lecture he didn’t pass the pointer array. He just passed the simple array.
@sachinjangid suppose you declare an array int arr[100] then arr becomes the pointer to that array which points to the first element of that array.
Oh… got it. Thanks
if your doubt is clear, please mark it as resolved.
How can I do that?? I can’t see the option here.
Oh, in that case i will mark the doubt as resolved
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.