// person.hh const int YOUNGER=-1, EQUAL_AGE=0, OLDER=1; const int LNAME = 50; // max. Laenge eines Namens struct Datum // Datensatz fuer das Datum { int tag, monat, jahr; }; struct Person // Datensatz fuer eine Person { char name[LNAME]; Datum geburtstag; float gehalt; }; /** Reads the data for a variable of structure Person @param t data to read */ void Read(Person& t); /** Prints the data for a variable of structure Person @param t data to print */ void Print(const Person& t); /** Compares the age of two persons. @param a first person @param b second person @return {-1, 0, 1} means person a is {younger, equal aged, older} wrt. person b */ int AgeComp(const Person& a, const Person& b); /** Sets an index vector idx such that Person a[idx[i-1]] is younger than or equal aged as a[idx[i]]. @param n #persons in array @param a array of persons @param idx index array */ void Sort(const int n, const Person a[], int idx[]); /** Sets an index vector idx such that Person a[idx[i-1]] is younger than or equal aged as a[idx[i]]. (C) Clemens Pechstein @param n #persons in array @param a array of persons @param idx index array */ void MinSort(const int n, const Person a[], int idx[]);