I’m trying to write a small program to log and track recipes, to familiarize myself with C++ and I/O.
I have a struct Recipe, and will store several Recipe objects in a data-structure (Vector or HashMap)
I want to serialize the Recipe objects from said DS, and plan to deserialize them back in to the DS upon loading. My question is: should I serialize the entire Data-Structure containing the Recipe objects, or serialize the elements individually? I’m considering using the Boost library as well to familiarize myself with that too.
I’ve tried to serialize with only fstream and .write((char*)&recipe, sizeof(recipe)), but found online that it isn’t a good practice. I also figured that it might be more of a hassle to serialize objects individually because they would all end up back into the DS anyways.