Try
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main()
{
struct staff
{
int id;
string name;
string cls;
};
vector <staff> s = {
{234, "Mark", "Biology"},
{3455, "Mitch", "English"},
{1234, "Hen", "Maths"}
};
sort( s.begin(), s.end(), [](const staff &a, const staff &b){ return (a.id < b.id);});
for (const auto & x : s)
cout << x.id << ", " << x.name << ", " << x.cls << endl;
}