#include <stdio.h>
#include <string.h>

struct person {
    char name[64];
    char sex; // 'm' or 'f'
    int year_of_birth;
};

struct student : person {
    int code;
    int year; // study year
    float average;
};

void print_person(const person &p)
{
    printf("%s, %d, %d\n", p.name, p.sex, p.year_of_birth);
}

int main()
{
    student s1;

    strcpy(s1.name, "John Doe");
    s1.sex = 'm';
    s1.year_of_birth = 1989;
    s1.code = 51311;
    s1.year = 2;
    s1.average = 4.75;

    person *p;
    p = &s1;
    person &ref1 = s1;

    print_person(s1);

    return 0;
}
