#include <stdio.h>
typedef struct _abc_
{
char a[10];
int b;
char c;
} ABC, *PABC;
void main()
{
ABC a[3] = {
"ABC", 123, 'A',
"BAC", 213, 'B',
"CBA", 321, 'C'};
FILE *fp = fopen("test.dat", "wb");
int i;
for (i=0; i<3; ++i)
fwrite(&a[i], sizeof(ABC), 1, fp);
fclose(fp);
ABC b[3];
fp = fopen("test.dat", "rb");
for (i=0; i<3; ++i)
fread(&b[i], sizeof(ABC), 1, fp);
fclose(fp);
for (i=0; i<3; ++i)
printf("%s\t%d\t%c\n", b[i].a, b[i].b, b[i].c);
}