human.cpp

来自「这个是我们学校用的VC++教案」· C++ 代码 · 共 35 行

CPP
35
字号
// Human.cpp: implementation of the CHuman class.
//
//////////////////////////////////////////////////////////////////////

#include "stdafx.h"
#include "Assert.h"
#include "Human.h"

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

//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
//IMPLEMENT_DYNAMIC(CHuman, CObject)
CHuman::CHuman()
{

}

CHuman::~CHuman()
{

}

void CHuman::AssertValid() const
{
 	CObject::AssertValid();   // 继承基类的对象有效性检查方法
   	ASSERT(m_year>0);     // m_year是类CHuman的数据成员
    ASSERT(m_year<120);
}

⌨️ 快捷键说明

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