Hi guys; I just passed in the tutrials on c++ regarding to sorting on basis specific pattern and I saw like thisforget from syntax error because I want to understand the concept behind)
Code:
Sort(array,compare)
Which compare is:
[code]
Compare(first,second)
{
Return (first<second)
}
[\code]
This means that the sort would be in ascending order..

What's confusing me; maybe second is the first and the first is second? So all messed up; Who said that the called function send to compare function in proper way as we thought in logic of compare?
I mean lets assume that
Code:
arr=[5,6]
Maybe the function send to compare second=5 ; first=6? So all thing in my logic function of compare will be messed up


Any help please?