score getscores[DATA];
fp = fopen("data.dat", "rb");
for (i = 0; i < DATA; i++) {
fread(&getscores[i], sizeof(getscores[i]), 1, fp);
printf("id:%d\tname:%s\tscore:%d\tdate:%s\n", getscores[i].id, getscores[i].name, getscores[i].score, ctime(&getscores[i].date));
}
fclose(fp);
}
#Clang #C言語