Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Calculating days between two dates in C
#9
SaptaZapta Wrote:C style would be more like
Code:
while (year1 < year2)
  days_until += 365 + if_leap(year1++);

more like
Code:
int i;
for (i = year1; i < year2; i++)
  days_until += 365 + if_leap(i);

Unless you actually want to modify the contents of year1, that is.
Reply


Messages In This Thread
Calculating days between two dates in C - by Nikkey - 2011-12-01, 08:51 PM

Forum Jump:


Users browsing this thread: