Parameter in inbuilt sort function

In inbulit sort function, why we took sort(a, a+n) and not sort(a, n+1) ?

Hello @udatta Here we take two parameters, the beginning of the array and the length n upto which we want the array to be sorted from the begining of the array.

Got it, but can you explain sort(a, a+n)? Here a is the index?

@udatta no a here is the array but we are taking the starting address of the array.