你的vector写法合适,也可以简写为
vector<Student> Vector = {{0, "aa", 98.1}, {1, "bb", 88.3}, {2, "cc", 96.1}};
sort(Vector.begin(), Vector.end(), my_compare);
对结构体数组排序
Student stu[] = {{0, "aa", 98.1}, {1, "bb", 88.3}, {2, "cc", 96.1}};
sort(stu, stu + 3, my_compare);