/* 用于标准输入/输出的头文件 */
#include /* 包含stdlib.h 因为本程序中要使用free, malloc函数 */
/* 以下代码定义一个结构体 */
struct Stuff
{
char full_name[20];
unsigned age;
unsigned gender;
};
/* *********************************** */
typedef struct Stuff stuff; /* 使用结构体自定义数据类型*/
/* 以下三个函数用来获取用户输入的整数、字符和字符串,详细说明请参见函数的注释*/
int input_integer(const char *promptText, unsigned prompt);
char input_char(const char *promptText,unsigned prompt);
int input_string(const char *promptText,const unsigned prompt, char *dest);
int main()
{
const short int max_size=10000;
stuff stuff_data[10000]; /*定义数组大小 */
short int absolute_position=0; /* 在数组中定位的变量 */
short int record_count=0; /* 用来存储记录总数的变量 */
char choose;
/* 这个循环用来询问用户是否输入新记录,当用户选择y或者Y时
输入新记录到数组元素中 */