snp-lab-code/P06_Lösung_Andrin/person.c

18 lines
294 B
C
Raw Normal View History

2022-04-07 14:24:54 +02:00
#include "person.h"
#include <string.h>
int person_compare(const person_t *a, const person_t *b) {
int result;
result = strcmp(a->name,b->name);
if(result) {
return result;
}
result = strcmp(a->first_name,b->first_name);
if(result) {
return result;
}
return a->age - b->age;
}