dimanche 1 mai 2022

Is it possible to sort the list of pair

//THis is how list of pair has defined

list<pair<string,car> >car_details;

//node creation


struct car{
    string id;
    string date;
    string etime;
    string exit_time;
    double price;
};

car carnode{id, date, s2, s1, amount}; //id,date,s2,s1 -string , amount -double

insert is being porformed like this, car_details.push_back(make_pair(id,carnode));

//Actually want to sort based upon that date attribute ( which is string in the format DD/MM/YYYY) like ( "29/04/2022)

Aucun commentaire:

Enregistrer un commentaire