person.h

来自「学生管理类,很好的」· C头文件 代码 · 共 35 行

H
35
字号
// person.h: interface for the person class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_PERSON_H__4CF36D8F_EB2D_43A7_AA8E_F3DB0065A9AB__INCLUDED_)
#define AFX_PERSON_H__4CF36D8F_EB2D_43A7_AA8E_F3DB0065A9AB__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#include <iostream.h>
#include <string.h>
#endif // _MSC_VER > 1000

class person  
{
	friend class Ban;
public:
    Person(){strcpy(name,"hello");age=16;sex=man;}
	virtual ~person();
	virtual void showInfo() 
	{
		cout<<name<<","<<age<<","<<(sex?"Woman":"Man")<<endl;
	}

	void change() {}  
	protected:
	char name[12];
	int age;
	enum Sex {man=0,woman=1};
	Sex sex;

};

#endif // !defined(AFX_PERSON_H__4CF36D8F_EB2D_43A7_AA8E_F3DB0065A9AB__INCLUDED_)

⌨️ 快捷键说明

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