0

I have a struct ABC that I want to serialize before sending over tcp socket. This ABC struct is nested and contains 10 more structs and each of these 10 structs contain 20 more structs. So, it's almost impossible for me to serialize it manually.

What is the best and simplest way to serialize these kind of structs in C++?

Adnan
  • 2,986
  • 7
  • 43
  • 63
  • Please refer to the question [Is it possible to automatically serialize a C++ object?](http://stackoverflow.com/questions/2126068/is-it-possible-to-automatically-serialize-a-c-object). – metacubed May 22 '14 at 07:56
  • the simplest way is to use the boost serialization library. There is not enough information in the question to tell you what the "best" way is because that will depend very much on your application. What's important to you? cross-platform transparency, portability, performance? etc. – Richard Hodges May 22 '14 at 08:09
  • Have you had a look at boost serialisation, cereal or flatbuffers? – Richard Hodges Oct 06 '22 at 05:22

0 Answers0