📄 person.h
字号:
#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 + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -