ch07_4.h
来自「Since the field of object oriented progr」· C头文件 代码 · 共 31 行
H
31 行
// Chapter 7 - Programming exercise 4
#ifndef CH07_4_H
#define CH07_4_H
class new_name : public name {
char sex;
public;
// Constructor to set all data to NULL. This will also
// call the name constructor with no parameters.
new_name(void) { sex = ' '; };
// Constructor to set sex to blank and pass the name
// to the parent class via a member initializer.
new_name(char *fn, char *mn, char *ln) :
name(fn, mn, ln) { sex = ' '; };
// This sets the sex to the input value, if it is either
// 'M' or 'F', otherwise it leaves it blank and returns
// an error value of zero.
int set_sex(char input_sex);
// This retrieves the value stored
char get_sex(void) { return sex; };
};
#endif
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?