"TDB" <vn*****@gmail.comwrote in message news
I'm creating an application using C which requires the data structures
like trees and graphs to be stored in files and retrieved later
( simply serialization of a data structure ) .
Is there any libraries available in C for this purpose ?
Yes and no.
One cannot store pointers in a file. Whilst there are general-purpose
libraries that purport to be able to serialise structures, using a
programmer-specified format string, these are so difficult to use that I
think it is red herring to recommend them.
However storing a tree is not too difficult. Simply write a bracket,
recursively write the subtree, and then write a closing bracket.
Loading is more tricky.
If you look for the Newick tree loader on my website you might find what you
are looking for. However it will only load trees, not graphs.
--
Free games and programming goodies.
http://www.personal.leeds.ac.uk/~bgy1mm