News for hackers. Stuff that matters.
Re:Why is day of the month 1-indexed but the month is 0-inde... by drallison on Tuesday November 24, 2020 @01:24AM (#25195869)
Everything is 0-indexed in C. It is convenient for each day in a month to correspond to it's ordinal position.For example, the Ides of March would be entry 15 in the structure containing data for the month of March. There is no 0-th day in a month so there are extra, unused entries but this is better than continually changing day values at each reference. The months are just a list and so are 0-indexed and dense.

There are no comments on this comment yet.