I have forgotten
my Password

Or login with:

  • Facebookhttp://facebook.com/
  • Googlehttps://www.google.com/accounts/o8/id
  • Yahoohttps://me.yahoo.com
Index » General » Open Forum »

need help

egiy\′s Photo
3 Aug 07, 10:49AM
(1 reply)
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:
will\′s Photo
3 Aug 05, 11:32PM
If I were you, I'd use the date functions from this site.

You need something like:

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&quot;");
  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.

Currently you need to be logged in to leave a message.