need help
need help
i need help.. im a noob at programming. i want to make a calendar just by using stdio.h. how do i do that? what about the formula?thanks! :cry:
3 Aug 05, 11:32PM
If I were you, I'd use the date functions from this site.
You need something like:
I've not tried compiling this, so you might want to post back the completed, debugged solution :) You'll need to do some additional formatting to get the first days of a month to align according to the week day names etc, but I'm sure that nothing you can't figure out yourself..
int idate = date(2005, 8, 1); for(int i=0; i<365; i++) // to get the next year from now. {; int day = day(idate); int month = month(idate&); int year = year(idate&); int dayofweek = dayOfWeek(idate); if(day==1) { // a new month printf("\n\n Month %s Year=%d\n", month_str(month), year); printf("Sun\tMon\tTues\tWed\tThur\tFri\tSat"); } if (dayofweek == 1) printf("\n""); printf("%d\t", day); idate++; } \n
I've not tried compiling this, so you might want to post back the completed, debugged solution :) You'll need to do some additional formatting to get the first days of a month to align according to the week day names etc, but I'm sure that nothing you can't figure out yourself..
Command [\endcode] not found.
Login