student.cpp

来自「MFC做的学生管理系统」· C++ 代码 · 共 57 行

CPP
57 行
字号
// Student.cpp: implementation of the CStudent class.
//
//////////////////////////////////////////////////////////////////////

#include "stdafx.h"


#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif

//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
IMPLEMENT_SERIAL(CStudent, CPerson, VERSIONABLE_SCHEMA | 1)

CStudent::CStudent()
{

}

CStudent::~CStudent()
{

}

/*void CStudent::Serialize(CArchive &ar)
{
	// 对象序列化保存
	if (ar.IsStoring())
	{
		ar << this->m_strName << this->m_strSex << this->m_nAge << this->m_strTel  << m_csScore.m_nComputer << m_csScore.m_nEnglish << m_csScore.m_nEthic  << m_strStuNum << m_strEducation;
	}
	else
	{
		ar >> this->m_strName >> this->m_strSex >> this->m_nAge >> this->m_strTel >> m_csScore.m_nComputer >> m_csScore.m_nEnglish >> m_csScore.m_nEthic  >> m_strStuNum << m_strEducation;	
	}
}*/

void CStudent::Serialize(CArchive &ar)
{
	// 对象序列化保存
	if (ar.IsStoring())
	{
        ar << this->m_strEducation << this->m_strStuNum ;
	}
	else
	{
		ar >> this->m_strEducation >> this->m_strStuNum ;
	}

	CPerson::Serialize(ar);
	this->m_csScore.Serialize(ar);
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?