why not we only use string a, string b in compare function
why not this type compare function
bool compare(string a,string b)
{
char *ptra=strtok((char *)a.c_str()," ");
char *ptrb=strtok((char *)b.c_str()," ");
int i=1;
while (i!=key)
{
ptra=strtok(NULL," ");
ptrb=strtok(NULL," ");
i++;
}
//cout<<a<<" "<<b<<" , "<<ptra<<" "<<ptrb<<endl;
if (revers=="false")
{
if(order=="numerical")
return int(ptra)<int(ptrb);
else
return ptra<ptrb;
}
else
{
if(order=="numerical")
return int(ptra)>int(ptrb);
else
return ptra>ptrb;
}
}