student.cpp

来自「mfc实验例题也是高教得配套资料 刚找到得 这部分应该是自学的内容」· C++ 代码 · 共 50 行

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

#include "stdafx.h"
#include "Ex3_1.h"
#include "Student.h"

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

//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
IMPLEMENT_SERIAL(CStudent,CObject,1)

CStudent::CStudent()
{

}

CStudent::~CStudent()
{

}

void CStudent::Serialize(CArchive& ar)
{
	CObject::Serialize(ar);

	if (ar.IsStoring())
	{
		// TODO: add storing code here
		ar<<m_sName;//<<m_nID<<m_sDepart<<m_nSex<<m_dComputer<<m_dEnglish<<m_dMath<<m_dPhysics;
	}
	else
	{
		// TODO: add loading code here
		ar>>m_sName;//>>m_nID>>m_sDepart>>m_nSex>>m_dComputer>>m_dEnglish>>m_dMath>>m_dPhysics;
	}
}

void CStudent::SetName(CString  str)
{
	m_sName =str;
}

⌨️ 快捷键说明

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