Calendar functions

i need someone to explain these functions to me, What do these functions do!


void leafCalendar(int inputYear, int inputMonth)
{
int StartToDay, LineBreak;

int TermToLine = (startToYear(inputYear) + startToMonth(inputYear, inputMonth)) % 7;
LineBreak = TermToLine;
for (StartToDay = 0; StartToDay < TermToLine; StartToDay++)
cout << " ";

for (StartToDay = 1; StartToDay <= finishToDay[inputMonth - 1]; StartToDay++)
{
cout << " " << setw(2) << setfill('0') << StartToDay;

if (LineBreak == 6) {
cout << "\n----------------------------" <<endl;
LineBreak = 0;
}
else
LineBreak++;


}

int startToMonth(int inputYear, int inputMonth)
{
int CheckToLeaf = 0;
for (int i = 1; i < inputMonth; i++)
CheckToLeaf += finishToDay[i - 1] % 7;
if (inputMonth > 2 && leafYear(inputYear))
CheckToLeaf++;

return CheckToLeaf % 7;
}
ode]
You mean, this code?
https://stackoverflow.com/questions/19884707/c-calendar-problems

> What do these functions do!
I'm going to take a stab in the dark and say "they print calendars".
The best way to understand stuff like this is to write it yourself.

Other people’s code for this kind of thing is often not so easy to read and make sense of.
Useful places to start are:

    The Calendar FAQ
    https://www.tondering.dk/claus/calendar.html

and

    The comp.lang.c Answers to Frequently Asked Questions (FAQ List)
    http://www.faqs.org/faqs/C-faq/faq/
Topic archived. No new replies allowed.