vendredi 9 avril 2021

How to sort a vector containing objects of class in C++? [duplicate]

the class(staff) contains objects int ID, string Name, string Class The vector contains

vector <staff> s = { {234, "Mark", "biology"},
{3455, "Mitch", "English"},
{1234, "Hen", "Maths"}}

How can I sort this from ID? and print sorted? Thank you

Aucun commentaire:

Enregistrer un commentaire