Hi,
I would like to ask about sorting lines in C++, (4 columns = 3 columns of integers and the last one a string):
3 56 3 NA
7 50 5 NA
2 100 1 OK
I tried the function sort() using a vector of strings, but failed in cases like 120 10023, where 10023 was sorted first than 120.
Does anyone have some idea?
Cheers,
SADS
string sortPed(ofstream &myfileLog, vector<string> &vetorPed, ofstream &myfileOut)
{
myfileLog << "\nSorting ..." << endl;
sort(vetorPed.begin(), vetorPed.end());
myfileLog << "SORTED! Printing ped file!" << endl;
printV(myfileLog, vetorPed);
printV(myfileOut, vetorPed);
}