list serialization with boost

Hello, I am a newbie of boost and I want to use it. I would like to serialize a list. The list is defined with the following data type: typedef struct person { char *name; char *first_name; struct person *next; } person; person *list_person; I have the list built from this structure and I want to serialize it on the hard disk. -- Regards Austina

2012/11/22 Olivier Austina
Hello, I am a newbie of boost and I want to use it. I would like to serialize a list. The list is defined with the following data type:
typedef struct person { char *name; char *first_name; struct person *next; } person;
person *list_person;
I'd suggest reorganizing your struct into struct person { std::string first_name; } and useing std::list<person> list. Then serializing and other operations would probably be trivial. But this does not answer your question if you can't change struct person. Can you? HTH, Kris
participants (2)
-
Krzysztof Czainski
-
Olivier Austina