Originally posted by vVv
I don't get it.
>How can i use structures to seperate the record fields
Code:
struct foo {
char *name,
*address;
int housenum;
} bar = {
"meh", "leggen", 123
};
....
fwrite( &bar, sizeof( struct foo ), 1, some_file );
/*
* rewind( some_file );
* fread( &other_structure, sizeof( struct foo ), 1, some_file );
* printf( "%s %s %d\n", other_structure.name, other_structure.address, other_structure.housenum );
*/
?!
I don't get it!
Code:
struct foo
{
char name[128];
char address[128];
int housenum;
}