C实现记录个人资料
代碼:
#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
總結
- 上一篇: C语言常用头文件总结
- 下一篇: C++的复习