student.cpp

来自「难得的动态链接库基础及应用程序」· C++ 代码 · 共 52 行

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

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

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

//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////

CStudent::CStudent()
{
	m_name[0]='\0';
	m_age=20;
}

CStudent::~CStudent()
{

}

// 成员函数的实现
void CStudent::Set_Name(char* pstr)
{
	strcpy(m_name, pstr);
}
char* CStudent::Get_Name()
{
	return m_name;
}
void CStudent::Set_Age(int a)
{
	m_age=a;
}
int CStudent::Get_Age()
{
	return m_age;
}
// 导出函数的实现
int Min(int a, int b)
{
	return a>b?b:a;
}

⌨️ 快捷键说明

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