## Re:Comparing two dates

I don't know how you are trying to do it but here are two functions, each of

which does the compare and each of which compiled without complaint:

-----------------------------------------

struct ftime {

unsigned ft_tsec : 5; /* Two second interval */

unsigned ft_min : 6; /* Minutes */

unsigned ft_hour : 5; /* Hours */

unsigned ft_day : 5; /* Days */

unsigned ft_month : 4; /* Months */

unsigned ft_year : 7; /* Year */

};

bool ASmallerThanB(ftime &a, ftime &b)

{

return (*reinterpret_cast<unsigned int *>(&a)) <

(*reinterpret_cast<unsigned int *>(&b));

}

bool ASmallerThanB2(ftime &a, ftime &b)

{

__asm {

mov eax,[a]

mov ebx,[b]

}

return _EAX < _EBX;

}

-----------------------------------------

. Ed

##### Quote

Jos?wrote in message

news: XXXX@XXXXX.COM ...

We know this structure, which is in io.h:

struct ftime {

unsigned ft_tsec : 5; /* Two second interval */

unsigned ft_min : 6; /* Minutes */

unsigned ft_hour : 5; /* Hours */

unsigned ft_day : 5; /* Days */

unsigned ft_month : 4; /* Months */

unsigned ft_year : 7; /* Year */

};

It contains exactly 32 bits and obviously it is stored as an integer.

But I cannot compare then.

a<b fails and so does (unsigned int)a < (unsigned int)b)

Is there a simple way to do it?