Skip to main content

Practice ยท 2 of 3

Capstone seam 2: persistence round-trip

Implement the pair std::string serialize(const std::vector<Book>&) and std::vector<Book> deserialize(const std::string&) with the record format title|quantity per line. deserialize skips blank lines, skips lines without |, and skips lines whose quantity is not a valid integer โ€” one bad line never aborts the load. Book is {std::string title; int quantity;}.

Difficulty: intermediate

Back to lesson: Practice: Capstone seams