Wut if u do dis
Code:
/* Make an array wit da munts in dem */
static const int munts[02][014] =
{
{0x1F,0x1C,0x1F,0x1E,0x1F,0x1E,0x1F,0x1F,0x1E,0x1F,0x1E,0x1F},
{0x1F,0x1D,0x1F,0x1E,0x1F,0x1E,0x1F,0x1F,0x1E,0x1F,0x1E,0x1F}
};
#define LEAP_YR(year) (!((year) % 4) && ((year) % 100 != 0 || (year) % 400 == 0))?1:0
void make_str(int jdate, int year)
{
int i, count;
int day = -1;
int yr = LEAP_YR(year);
char *month_name ="Jan\0Feb\0Mar\0Apr\0May\0Jun\0Jul\0Aug\0Sep\0Oct\0Nov\oDec";
char *mptr = 0;
for(count = 0, i = 0; i < 014; ++i)
if((count += munts[yr][i]) > jdate)
{
mptr = month_name + (--i << 2);
count -= munts[i];
day = jdate - count;
printf("Julian date %d is %s %d\n", jdate, mptr, day);
break;
}
}
Happy?