#include "stdafx.h" #include #include struct Date { int Day; int Month; int Year; }; struct Student { char FirstName[20]; char LastName[20]; int Age; Date Date; }; int main() { int n = 10; Student *arr = (Student*)calloc(sizeof(Student), n); // Write FILE *f = fopen("e:\\students.bin", "wb"); fwrite(&n, sizeof(int), 1, f); fwrite(arr, sizeof(Student), n, f); fclose(f); free(arr); // Read FILE *f = fopen("e:\\students.bin", "rb"); fread(&n, sizeof(int), 1, f); arr = (Student*)calloc(sizeof(Student), n); fread(arr, sizeof(Student), n, f); fclose(f); free(arr); return 0; }