C实现记录个人资料

102 阅读1分钟

代码:

 

#include <stdio.h>
#include <ctype.h>
#include <stdlib.h>
#include <string.h>

struct Family *get_person(void);    /* Prototype for input function */
char related(struct Family *pmember1, struct Family *pmember2);
char set_ancestry(struct Family *pmember1, struct Family *pmember2);

struct Date   
{
	int day;
	int month;
	int year;
};

struct Family                      /* Family structure declaration   */
{
	struct Date dob;
	char name[20];
	char father[20];
	char mother[20];
	struct Family *next;            /* Pointer to next structure      */
	struct Family *previous;        /* Pointer to previous structure  */
	struct Family *p_to_pa;         /* Pointer to father structure   */
	struct Family *p_to_ma;         /* Pointer to mother structure   */
};

void main()
{
	struct Family *first = NULL;    /* Pointer to first person        */
	struct Family *current = NULL;  /* Pointer