struct contestant
{
int prob,time;
bool operator < (const struct contestant &c ) const
{
if( this->prob > c.prob ) return 1;
else if( this->prob == c.prob)
{
if( this->time <= c.time ) return 1;
return 0;
}
return 0;
}
} con[1000];
when i applly library sort function sort(con,con+size) when storing elements in structure from 0...size-1 it works fine when same sort function used like sort(con+1,con+size+1) when storing elements in structure con from 1...size works incorrectly... any help please... thanks in advance...