这是一个C语言基础上的图书管理系统,对于结构体,文件,指针用的比较多,希望具有参考价值!!!!!!!!!!!!!!!!!!!
/*THE LIBRARY*/
#include<stdio.h>
#include<string.h>
#include<stdlib.h>
#include<conio.h>
/********The definition of book structure********/
typedef struct booklist
{
char author[20]; /* author */
char name[20]; /* name */
char topic[20]; /* topic */
char ISBN[20]; /* ISBN */
char state[20]; /* state */
char num[20]; /* nummber */
char position[20]; /* position */
}booklist;
char state[5][20]; /* state */
void ShowMain0()
{
system("cls"); /*cls*/
printf(" Tips: Enter the next step\n\n");
printf(" Tips: You can now enter the book information, you can follow the message input has the title,author, subject, ISBN, and now the state, the number of locations.\n");
printf(" Now please enter your registration book information.\n\n");
system("PAUSE");
}
void ShowMain1()
{
printf("\n\t\t THE LIBRAY(Support Chinese Input)\n");
printf(" |^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^|\n");
printf(" | 1:I will borrow this book. |\n");
printf(" | 2:I will not borrow this book. |\n");
printf(" | 0:Return |\n");
printf(" ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n");
printf("\n Tips: Enter the next step ");
printf("\n");
}
void ShowMain2()
{
printf("\n\t\t THE LIBRAY(Support Chinese Input)\n");
printf(" |^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^|\n");
printf(" | 1:I will return this book. |\n");
printf(" | 2:I will renew this book. |\n");
printf(" | 0:Return |\n");
printf(" ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n");
printf("\n Tips: Enter the next step ");
printf("\n");
}
void ShowMain3()
{
system("cls"); /*cls*/
printf("Tips:Enter the next step\n");
printf("You will get the information of the book.\n\n");
}
/********************************** Seek the information of books *******************************/
void SeekBook()
{
FILE *fp;
booklist *OutInfo;
char findname[20];
printf("Please input the book taht you want:");
scanf("%s",findname);
fp=fopen("