| structures/struct-motivation.c - Motivation for structures - logisk sammenhørende, men sideordnede variable. | Lektion 12 - slide 7 : 36 Program 1 |
#include <stdio.h>
typedef unsigned long CPR;
int main(void) {
char *baby_name = "Paul";
CPR baby_cpr = 2304031577;
CPR baby_father_cpr = 1605571233;
CPR baby_mother_cpr = 2412671234;
char *mother_name = "Anna";
CPR mother_cpr = 2412671234;
CPR mother_father_cpr = 1605376789;
CPR mother_mother_cpr = 1201402468;
char *father_name = "Frank";
CPR father_cpr = 1605571233;
CPR father_father_cpr = 1111331357;
CPR father_mother_cpr = 1212358642;
printf("%s's mother and father is %s and %s\n",
baby_name, mother_name, father_name);
return 0;
}