Question: I have a daemon for a scientific instrument that needs to persist about 100 unique variables. Currently, these settings are stored in binary form at explicit addresses, and each is accessed with a unique getter and setter. This is completely unmaintainable. I'd like to group settings together in sensible structures and persist those structures into files. I'll also have default values in case of incomplete files. What library or technique will allow me to save and restore these structures with as few lines of code as possible?

Answer: 
You can't simply serialize them using a library if you want human-readable files. You need to write a function which, given a filename and the structures, will write the contents of the structures in the file.I'd suggest you use a one line = one member basis, but write the name of the member too, so that you'll find which members are missing, this way: `name:value`.  

Then, another function will need to retrieve a structure from the file. Instead of writing your own format, you could use JSON with the [`jansson`](http://www.digip.org/jansson/) library. \*\*EDIT: As the comments said, [`libjson`](http://sourceforge.net/projects/libjson/) is another alternative, usable both in C and C++.
"Shortest" have several meanings

* fast to process
* eating as little as memory as possible
* easy and quick to code

I would suggest to use a simple textual format to serialize them, probably [JSON](http://json.org/) (or maybe [YAML](http://en.wikipedia.org/wiki/YAML) or XML). The advantage of such formats is that they remain somehow human "readable" (at last for a programmer).

There exist a lot of JSON libraries (notably in C and C++): [jansson](http://www.digip.org/jansson/) in C, [jsoncpp](http://jsoncpp.sourceforge.net/) for C++, etc etc...

Does your scientific instrument runs only a tiny 8 bit controller? If yes, you might be constrained by code size...

And I suggest also to *document* the serialized format.