Can i use &array[n-1] rather than using array+n
as a parameter for the sort function
Doubt regarding code
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. . .
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
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 !!..