C ++ I/O类结构 [英] C++ i/o classes structure
本文介绍了C ++ I/O类结构的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我真的很困惑所有这些类:basic_filebuf,basic_fstream,basic_ios,...
您能否给我一个链接,以说明视觉演示或所有这些课程?
我有这样的记录:
I''m really confused with all those classes out there: basic_filebuf, basic_fstream, basic_ios, ...
could you please give me a link to somewhere to illustrate a visual presentation or something of all these classes?
I have a record like this:
struct RECORD
{
unsigned int uiID;
string strWord;
.
.
.
}
并且我想将我的记录序列化到文件中或从文件中序列化.
and I''d like to serialize my records to/from a file. which class best suit me?
推荐答案
都不是:)
看看协议缓冲区基础:C ++ [ fstream [
None of them :)
Have a look at Protocol Buffer Basics: C++[^]
It will make things a bit easier ... it uses the ios library, but takes care of the serialization
Or just use fstream[^] directly and roll your own serialization code.
Best regards
Espen Harlinn
使用c ++ boost库.
use the c++ boost libraries.
这篇关于C ++ I/O类结构的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文