Printf("\t\t\tBook authorName = %s",thorName) Printf("\t\t\tBook name = %s",addBookInfoInDataBase.bookName) Printf("\n\t\t\tBook id = %u\n",addBookInfoInDataBase.books_id) If(!strcmp(addBookInfoInDataBase.bookName, bookName)) While (fread (&addBookInfoInDataBase, sizeof(addBookInfoInDataBase), 1, fp)) Printf("\n\n\t\t\tEnter Book Name to search:") Printf("\n\t\t\tFacing issue while reading file\n") If (fseek(fp,FILE_HEADER_SIZE,SEEK_SET) != 0) If the book is not available in the list, it shows the message book not find in records. This function opens the binary file in reading mode and asks the user to enter the book name which wants to search. Printf("\n\t\t\tPlease enter a valid date.\n") įwrite(&addBookInfoInDataBase,sizeof(addBookInfoInDataBase), 1, fp) Status = isValidDate(&addBookInfoInDataBase.bookIssueDate) Printf("\n\t\t\tEnter date in format (day/month/year): ") Status = isNameValid(addBookInfoInDataBase.studentName) Status = isNameValid(thorName) įgets(addBookInfoInDataBase.studentName,MAX_STUDENT_NAME,stdin) Please enter again.") įgets(thorName,MAX_AUTHOR_NAME,stdin) Printf("\n\t\t\tName contain invalid character. Status = isNameValid(addBookInfoInDataBase.bookName) Scanf("%u",&addBookInfoInDataBase.books_id) įgets(addBookInfoInDataBase.bookName,MAX_BOOK_NAME,stdin) Printf("\n\n\t\t\tENTER YOUR DETAILS BELOW:") This function opens the binary file in append mode and writes the book and the details. Printf("\n\n\n\t\t\tINVALID INPUT!!! Try again.") Return (validDate->dd dd mm = 4 || validDate->mm = 6 || I have permitted this function to take the space in names. Printf("\n\n\n\t\t\t Enter any key to continue.") This function displays the first welcomes screen of the “Library management system project” and asks the user to press any key to access the library application. Printf("\n\t\t\t# Library management System Project in C #") It prints the message on the top of the console and prints the message as per operation. void printMessageCenter(const char* message) I have passed the message in this function as per the operation. This function prints the message in the middle of the head massage. Strncpy(ername,defaultUsername,sizeof(defaultUsername)) įwrite(&fileHeaderInfo,FILE_HEADER_SIZE, 1, fp) Strncpy(fileHeaderInfo.password,defaultPassword,sizeof(defaultPassword)) void init()Ĭonst char defaultUsername ="aticleworld\n" Ĭonst char defaultPassword ="aticleworld\n" This function creates the file if not exist and copies the default password (“aticleworld”) in file header structure. If the file exists, the function return 1 otherwise returns 0. This function verifies that a file has been created or not. List of a function used in “Library management system project in C” Use the code to learn and do the project yourself. Note: Don’t copy and paste the code for your project. Each function of the project extensively use the file handing function, so it is also a great project to understand file handling. Also to increase the redabilty I have broken the application in different function.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |