你所知道的MFC序列化

CFile testFile(_T("test.dat"), CFile::modeWrite);
CArchive arSave(&testFile, CArchive::store);
arSave << _T("SoBe") << 6655;
arSave.Close();
testFile.Close();

CString str = _T("");
int n = 0;

testFile.Open(_T("test.dat"), CFile::modeRead);
CArchive arLoad(&testFile, CArchive::load);
arLoad >> str >> n;
arLoad.Close();
testFile.Close();

先看看这段代码,不知道你有什么感觉呢?

在你还没有动手打开IDE进行调试前,你认为这段代码有没有什么问题?

如果有问题,那又是什么问题呢?

望各位大牛不吝赐教啊~~~

posted @ 2011-03-14 14:39  qbingo  阅读(1541)  评论(2编辑  收藏  举报