struct hoge {
 int a;
 char b;
 double c;
};

struct hoge buf;

// 書き込み
fwrite(&buf, sizeof(buf), 1, fp);

// 読み込み
fread(&buf, sizeof(buf), 1, fp);