pro*_*eek 7 c++ python serialization
我在Python中使用struct.pack将数据转换为序列化字节流.
>>> import struct >>> struct.pack('i', 1234) '\xd2\x04\x00\x00'
C++中的等价是什么?
Oli*_*rth 1
没有一个。C++ 没有内置序列化。
您必须将单个对象写入字节数组/向量,并注意字节顺序(如果您希望代码可移植)。
归档时间:
13 年,1 月 前
查看次数:
5527 次
最近记录:
6 年,10 月 前