求一C或C++编写的程序,实现串行化功能

来源:百度知道 编辑:UC知道 时间:2024/05/24 17:50:31
题目如下:串行化功能的实现(Serialize函数)。要求可以通过一个对话框输入信息,然后使用“保存”菜单来存储输入的信息,或者通过“打开”菜单来读取存储的信息。

注:确定设计程序接收的输入数据和输出数据的形式,取值范围。初步列出各子程序模块间的调用关系。列出调试中遇到的主要问题,并说明解决方法。

另外要求绘制程序的流程图,以及各子程序模块间的调用关系。还要分析算法的时间和空间复杂度,说明编写程序的使用方法,详细列出每一操作步骤。

这个对我真的非常重要,如果有满意的答案我会将分数倾囊相赠!!!!希望回答的人不哟啊吝惜自己的时间!!! 如果有意思的可以留下自己的QQ,网上详谈!!!!! 谢谢啦!!!!!

这个我也学习学习。。

不明所以,你描述的东西扯都扯不到一起。先研究研究要你的课题,你就知道怎么做了,至少知道该怎么提问。

串行化主要有五个步骤,你可以参考文档写啊,其实不难的。
Five main steps are required to make a class serializable. They are listed below and explained in the following sections:

1:Deriving your class from CObject (or from some class derived from CObject).

2:Overriding the Serialize member function.

3:Using the DECLARE_SERIAL macro in the class declaration.

4:Defining a constructor that takes no arguments.

5:Using the IMPLEMENT_SERIAL macro in the implementation file for your class.
例子:
class CPerson : public CObject
{
public:
DECLARE_SERIAL( CPerson )
// empty constructor is necessary
CPerson(){};

CString m_name;
WORD m_number;

void Serialize( CArchive& archive );

// rest of class declaration
};

To override the Serialize member function

Call y