I’m wondering if C has anything similar to the python pickle module that can dump some structured data on disk and then load it back later.
I know that I can write my structure byte by byte to a file on disk and then read it back later, but with this approach there’s still quite some work to do. For example, if I have a single link list structure, I can traverse the list from head to tail and write each node’s data on disk. When I read the list back from the on-disk file, I have to reconstruct all links
between each pair of nodes.
Please advise if there’s an easier way.
Thanks heaps!
An emphatic NO on that one, I’m afraid. C has basic file I/O. Any structuring of data is up to you. Make up a format, dump it out, read it in.
There may be libraries which can do this, but by itself no C doesn’t do this.