"serializing" structs in C
From: copx (invalid_at_invalid.com)
Date: 12/30/03
- Next message: Martin Dickopp: "Re: C99 Question"
- Previous message: Martin Dickopp: "Re: segmentation fault on calloc"
- Next in thread: lallous: "Re: "serializing" structs in C"
- Reply: lallous: "Re: "serializing" structs in C"
- Reply: Martin Dickopp: "Re: "serializing" structs in C"
- Reply: CBFalconer: "Re: "serializing" structs in C"
- Reply: Keith Thompson: "Re: "serializing" structs in C"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Tue, 30 Dec 2003 11:15:34 +0100
I want to save a struct to disk.... as plain text.
At the moment I do it with a function that just
writes the data using fprintf. I mean like this:
fprintf(fp, "%d %d", my_struct.a, my_struct.b)
This way I have to write another "serializing"
function for every new kind of struct I want
to write, though. Is there a way to write
functions that can write/read any struct
to/from plain text format in a portable way?
copx
- Next message: Martin Dickopp: "Re: C99 Question"
- Previous message: Martin Dickopp: "Re: segmentation fault on calloc"
- Next in thread: lallous: "Re: "serializing" structs in C"
- Reply: lallous: "Re: "serializing" structs in C"
- Reply: Martin Dickopp: "Re: "serializing" structs in C"
- Reply: CBFalconer: "Re: "serializing" structs in C"
- Reply: Keith Thompson: "Re: "serializing" structs in C"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]