Code Style Review

Pages: 12
It did indeed help. Thanks for explaining that for me.
But apparently you shouldn't use using namespace std; in header files, why is that?
Because it kills the purpose of namespaces.
You include that header and pollute the global namespace with the things from std, making it more likely to have name collisions.

By the way, the get_year() functions presented are hard to reuse.

since dates are never negative.
¿They aren't?
¿They aren't?


I was thinking the same thing. Didn't want to do a research paper, but it looks like leap years started in 47bc. Here's a little quote from:
http://www.leapyearday.com/content/celebrate-spin

The system of three 365-day years followed by one 366-day Leap Year began in 47 B.C. The extra day was added to the last month of the year, which at that time was February.

...Although Caesar was on the right track, the passing of several centuries revealed that his system wasn’t going to work....

Fifteen centuries after Caesar and Susigenes first got the ball rolling, Pope Gregory XIII and astronomer Christopher Clavius revised the plan and developed the Gregorian calendar, which we still use today.

They kicked it off by eliminating 11 days. In the year 1582, October 4 was immediately followed by October 15. Additionally, December became the last month of the year.

Finally, in order to eliminate the extra 3 Leap Years occurring, century years (ending in 00) must be divisible by 400 to be designated a Leap Year. So 1700, 1800 and 1900 were not Leap Years, but the years 1600 and 2000 were.



Topic archived. No new replies allowed.
Pages: 12