#include //struct person{ // char name[50]; // int height; //}; typedef struct person{ char name[50]; int height; }typePer; int main(){ //struct person group1[5], group2[5]; typePer group1[5], group2[5]; FILE *entrada; int i; entrada = fopen("filebin.txt","wb"); for(i=0;i<5;++i){ fflush(stdin);//limpa entrada de dados printf("Enter name: "); gets(group1[i].name); printf("Enter height: "); scanf("%d",&group1[i].height); } fwrite(group1,sizeof(group1),1,entrada); fclose(entrada); entrada = fopen("filebin.txt","rb"); fread(group2,sizeof(group2),1,entrada); for(i=0;i<5;++i) { printf("Name: %s\nHeight: %d",group2[i].name,group2[i].height); } fclose(entrada); }