serialize in .NET, deserialize in C++

前端 未结 7 949
死守一世寂寞
死守一世寂寞 2021-02-13 20:03

I have a .NET application which serializes an object in binary format. this object is a struct consisting of a few fields.

I must deserialize and use this object in a C+

7条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-02-13 20:30

    Use XML Serialization its the best way to go, in fact is the cleanest way to go.

    XmlSerializer s = new XmlSerializer( typeof( YourClassType ) );
    TextWriter w = new StreamWriter( @"c:\list.xml" );
    s.Serialize( w, yourClassListCollection );
    w.Close();
    

提交回复
热议问题