Home Forums C Programming license validation Re: Re: license validation

#3563
GWILouisaxwzkla
Participant

If you want to see if a date is less than another , I would do:


if ( expirationYear > licenseYear )
licenseValid = true;
else if ( expirationYear == licenseYear )
{
if ( expirationMonth > licenseMonth )
licenseValid = true;
else if ( expirationMonth == licenseMonth )
{
if ( expirationDay > licenseDay )
licenseValid = true;
else if ( expirationDay == licenseDay )
licenseValid = true;
else
licenseValid = false;
}
else
licenseValid = false;
}
else
licenseValid = false;