univ.h

来自「简单二叉树的连表算法」· C头文件 代码 · 共 45 行

H
45
字号
class univ_community 
{
	friend class tree;
protected:
	char last_name[15];
	char first_name[15];
	int age;
	long social_security_number;
public:
	univ_community(char *ln,char *fn,int a,long ss)
	{
		strcpy(last_name,ln);
		strcpy(first_name,fn);
//		age=a;
//		social_security_number=ss;
	}
	univ_community(){last_name[0]='\0';
	first_name[0]='0';
//	age=0;
//	social_security_number=0;
	}
	void set_last_name(char *last_n)
	{
		strcpy(last_name,last_n);
	}
	void set_first_name(char *first_n)
	{
		strcpy(first_name,first_n);
	}
/*	void set_age(int a)
	{
		age=a;
	}
	void set_social_security_number(long soc_sec)
	{
		social_security_number=soc_sec;
	}*/
	virtual void print()
	{
		cout<<endl<<last_name
			<<first_name<<"Age:"<<age<<endl
			<<"Social Security #"<<social_security_number;
		 
	}
};

⌨️ 快捷键说明

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