msgpack-c
msgpack-c copied to clipboard
Pack map or array
Hi guy,
Another question, when I pack map or array, I must set the size of pack_map/pack_array. But I do not know the size of it when I do the pack_map/pack_array, Do there have other ways?
Best, Mack
Due to msgpack format https://github.com/msgpack/msgpack/blob/master/spec.md#formats-array , you need to set size first.
When you don't know the size of them, you could use std::vector or std::map as a buffer. But I'm not sure about your usecase.
Thank you, redboltz.