silviana_amethyst
about
gallery
reading guides
computational_projects
papers_presentations
work_blog
useful_pages
teaching
20210fall2016
6_40212spring2017
Download the exam
Topic sheet
For Problem 2
#include
struct Employee{ name; age; gender; } int main(int argument_count, char** args) { ifstream fin(datafile); ofstream fout(datafile); vector
emps; while (datafile >> Employee) emps.push_back(Employee); sort(emps.begin(), emps.end(), age); fout << emps; }
name age gender Hahn 21 m Fleming 64 m Lyons 59 f Davenport 74 nb Waller 37 m Gay 28 F Kidd 53 M Malone 13 M Walker 81 f Mullins 74 f Crawford 63 f