#include struct str { int f1; double f2; char f3; char *f4; }; int main(void){ FILE *ofp; struct str rec= {5, 13.71, 'c', "xyz"}; ofp = fopen("data", "w"); fwrite(&rec, sizeof(struct str), 1, ofp); fclose(ofp); return 0; }