Error handling data properly in a temporary file in C++ file handling
I am developing a library management system in C++ and have implemented a function to handle book returns. The function reads book records from a file, checks if a book is issued, and then writes the updated records to a temporary file. When I attempt to return a book that is not issued, the function correctly displays a message saying that the book was not issued. However, the book record is not written to the temporary file, which causes the record to be missing in the updated file.
The problem is that when the book is not issued, the else block (for non-issued books) is executed, but the book record is not written to the temporary file.
Code’s getting crashing when i try to read a binary file by class objects
I’m trying to do a basic project that was bank management system. I need to store and access the information from binary file using file handling. I had successfully write the information by class objects into the file. But, the code is getting crashed when i was reading from the file by class objects.