home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Power-Programmierung
/
CD1.mdf
/
xbase
/
library
/
clipper
/
rettig
/
source
/
_tr_ldm.c
< prev
next >
Wrap
C/C++ Source or Header
|
1990-10-21
|
539b
|
27 lines
/*********
* _tr_ldm.c
*
* by Tom Rettig
*
* Placed in the public domain by Tom Rettig Associates, 10/22/1990.
*
* Syntax: _tr_ldm( <month>, <year> )
* Return: int last day of the month
* zero if invalid <month> or <year>
********/
#include "trlib.h"
int _tr_ldm(month,year)
int month, year;
{
static int lday[13] = { 0,31,28,31,30,31,30,31,31,30,31,30,31 };
if ( ISYEAR(year) && ISMONTH(month) )
return( (ISLPYR(year) && month==2) ? 29 : lday[month] );
else
return( 0 );
}