That would be because there is nothing after the print line telling it to go back and search again with the new title.
What you could do is put another while loop around all of that, like so:
Code:
while (!flag)
{
while (fread(&tmp,sizeof(record_structure),1,record_file))
{
if (strcmp(searchtitle,tmp.Title) == 0)
{
printf("\n\n\nTitle: %s \t\tAuthor: %s \t\tISBN: %s\n", tmp.Title, tmp.Author, tmp.ISBN);
flag = 1;
break;
}
}
printf("\nThe title you entered does not exist please re-enter: ");
[do whatever you need to do here to make the newly entered title enter the variable searchtitle]
}
Then, if the search title is not found, flag will remain 0 and it will start the loop over again. You may need to rewind the file back to the beginning before you enter the second while loop. I am sorry for the non-code in brackets there, but I have only just started following the thread and i am not sure how you are storing in searchtitle, so I'll leave that detail to you.