You did not specify whether it is for MFC C++ or something else, so here's the MFC version of it...
1. Get date/time when the book was issued:
CTime bookIssued = CTime::GetCurrentTime();
2. Get date/time when the book was returned:
CTime bookReturned = CTime::GetCurrentTime();
3. Calculate the difference in days:
CTimeSpan diff = bookReturned - bookIssued;
__int64 days = diff.GetDays();
Your variable
days
now has the number of days that you need.