我们可以使用C++项目,需要将对象从json串中进行序列化和反序列化。在C#中,我们使用JSON.NET。我们只需调用:
We can C++ project and we need to (de) serialize objects from and into json.
In C# we are using JSON.NET. We simple call:
string json = JsonConvert.SerializeObject(product);
var myNewObject = JsonConvert.DeserializeObject<MyClass>(json);
非常简单和有用。
是否有人知道免费的C++库,可以像在C#中那样简单地使用它?
我们正在使用JsonCpp,但它不支持此功能。
非常感谢 问候
c++
,请不要为c
添加标签。它们不是同一种语言。 - Samidamaru