person.cpp

来自「Visual+C+++课程设计案例精编(附书代码),有通讯录,聊天程序等源吗,对」· C++ 代码 · 共 45 行

CPP
45
字号
// Person.cpp: implementation of the CPerson class.
//
//////////////////////////////////////////////////////////////////////

#include "stdafx.h"
#include "AddressBook.h"
#include "Person.h"

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

//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
IMPLEMENT_SERIAL(CPerson,CObject,0)
CPerson::CPerson()
{
	//初始化人员信息(m_Name,m_Phone,m_Company,m_Email)
	m_Name="";    //姓名
	m_Phone="";   //电话
	m_Company=""; //公司
	m_Email="";   //Email

}

CPerson::~CPerson()
{

}
void CPerson::Serialize(CArchive& ar)
{
	if (ar.IsStoring())
	{	
		ar<<m_Name<<m_Phone<<m_Company<<m_Email;
		// storing code
	}
	else
	{	// loading code
		ar>>m_Name>>m_Phone>>m_Company>>m_Email;
	}
}

⌨️ 快捷键说明

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