// Read from file then display Loan
while (!loanf.eof())
{
loanf.read(reinterpret_cast<char*> (&newLoan), sizeof(Loan));
displayLoan(newLoan);
}
For some reason the last Loan object is being read twice. Here is the output I get..you will notice the bottom is doubled when it should not be as I only have 5 loan objects in the file.