#include "stdafx.h" #include<stdlib.h> #include<string.h> struct Date { int day; int month; int year; }; struct Student { char firstName[20]; char lastName[30]; Date dateOfBirth; }; Student ReadStudent() { Student newStud; printf(" firstName: "); gets_s(newStud.firstName); printf(" lastName: "); gets_s(newStud.lastName); printf(" day: "); scanf("%d", &newStud.dateOfBirth.day); printf(" month: "); scanf("%d", &newStud.dateOfBirth.month); printf(" year: "); scanf("%d", &newStud.dateOfBirth.year); return newStud; } void PrintStudent(Student stud) { printf("Student: %s %s (%d-%d-%d)", stud.firstName, stud.lastName, stud.dateOfBirth.day, stud.dateOfBirth.month, stud.dateOfBirth.year); } int main() { Student one, two; printf("One: \n"); one = ReadStudent(); printf("Two: \n"); two = ReadStudent(); PrintStudent(one); PrintStudent(two); return 0; }