#include struct str { int f1; double f2; char f3; char *f4; }; int main(void){ FILE *ifp; struct str rec; ifp = fopen("data", "r"); fread(&rec, sizeof(struct str), 1, ifp); printf("f1=%d, f2= %f, f3 = %c, f4= %s\n", rec.f1, rec.f2, rec.f3, rec.f4); fclose(ifp); return 0; }