So I am writing a code to generate a yearly calender based on the year put it in and the day of the week January starts on, and it takes into acoount whether it is a leap year or not
Right now I am able to print out the month of January, but I want to be able to print out all of the months, how would I go about doing this?
Whenever you find yourself repeating something, make a function and call it in a loop.
Now, there is a trick to the "make a calendar" program that trips people up. You can't just cout to the console right away if you want to line up three months in four rows.
If you want to do it that way then you'll need to have a 2D array of characters as wide as three months and as tall as one month (counting the worst case).
Then your 'print month' function must also take as argument a column offset into the array. Once you have three months, cout your array and go on to the next three months.
Don't let it overwhelm you. Get your program working just printing a single month per row, then backup your working program, then update the program do do as above.
Hope this helps.
[edit] I can't remember the link, but there's a FAQ for handling dates and time. When I get home later tonight I'll update for you.