| baby-mother-father-struct.c - Introduktion af structures - sammenhørende data om en person. | Lektion 9 - slide 7 : 29 Program 2 |
#include <stdio.h>
typedef unsigned long CPR;
struct person {
char *name;
CPR cpr;
CPR father;
CPR mother;
};
int main(void) {
struct person
baby = {"Paul", 2304031577, 1605571233, 2412671234},
mother = {"Anna", 2412671234, 1605376789, 1201402468},
father = {"Frank", 1605571233, 1111331357, 1212358642};
printf("%s's mother and father is %s and %s\n",
baby.name, mother.name, father.name);
return 0;
}