1

我在 C++ 中使用 cURL 和 Microsoft SEAL。我需要序列化一个 Ciphertext 对象以通过 POST 请求将其发送到服务器。

Ciphertext 对象被序列化为 astringstream但是,为了发送它,我需要将它转换为const char*. 问题是,最初,从 获得的字符串stringstream是 88500 字符长(大约);但是,当转换为 时const char*,它会减少到 6。

第 7 个字符可以是 '\0',所以它被检测为字符串的结尾吗?(两者都.c_str()返回.data()相同的结果。)

stringstream st;
cipheredAspirineList[0].save(st);
simplePost("postSingleCipheredAspirine", st.str().c_str());
4

0 回答 0