person.h

来自「用C++写的一个简单学籍管理系统」· C头文件 代码 · 共 40 行

H
40
字号
#pragma once
#ifndef  _PERSON_H_
#define _PERSON_H_
#include <string>
using namespace std;
enum Sex
{
	MALE,
	FEMALE
};

istream &operator >>(istream & ,Sex & );
class Person
{
	

public:
	Person( const char *,const int = -1, const Sex=MALE );
	Person( const string,const int = -1, const Sex =MALE);
	Person( const Person &);
	virtual ~Person( );

    Person& operator=(const Person &);


	const string getName( )const;
	const int getId ( )const;
	const Sex getSex( )const;
	void setName ( char * );
	void setName ( string );
	void setId ( int );
	void setSex ( Sex  );


//protected:
	int id;
	string name;
	Sex sex;
};
#endif

⌨️ 快捷键说明

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