what does it mean when we say that we can pass a part of an array to a function.
Array as pointer
@poojadas408
There are some functions like the inbuilt sort function, upper_bound and lower_bound in which it is possible to operate on an certain portion of the array using pointers pointing to a certain region of the array. Like in the inbuilt sort function, you can sort a segment of the array by manipulating the region you pass into the function.
Suppose array arr has size n. Then performing sort(arr, arr + n) sorts the entire array, while sort(arr, arr + i), where i < n sorts only a segment of the array ranging from index 0 to (i - 1).
If my answer was able to answer the query, please 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.