Doubt regarding code

Can i use &array[n-1] rather than using array+n
as a parameter for the sort function

hello @HyperX
u need to use &a[n] in place of n-1 becuase we want address of block which is next of last element of array.

but then make sure u declare ur array of size atleast n+1 becuase here u will be accessing index n.

Oh okay, but how is it working with n-1 also?

pls share ur code i will check. . .

https://firebasestorage.googleapis.com/v0/b/klets-3642/o/user_files%2F2LhQvB3j%2F51d5911621b64a1aad2eb2b50a6bb79a%2Fimage.png?alt=media&token=652d86d7-d1e5-4536-87ca-17d713abe6d3

@HyperX

paste ur code here->https://ide.codingblocks.com/

press ctrl+ s and save
a link will be generated in ur search bar.
share that link with me

@HyperX

see on giving n-1 , it will leave the last element and will sort only first n-1 elements.

use &a[n] to make it work for all elements

okay, thanks !!..