Mail Archives: djgpp/2001/03/17/23:38:53
Hi,
I'm trying to modify a source code written in Microsoft C so that I can
compile it using GCC. Now I got stuck modifying the code.
In the code, I declared two integer variables.
int computedChecksum=0;
int recordChecksum=0;
Then, somewhere in the program I wanted to test the equality of these two
variables.
if (computedChecksum==recordChecksum)
But, I wanted to test the equality of the two least significant digits of
the variable computedChecksum and the variable recordChecksum. The variable
recordChecksum has only two significant digits.
I run the code using a test file and the computedChecksum has a value of
FFFFFCFCh while recordChecksum has a value of FCh. Now, I'm only interested
in the two least significant digits of computedChecksum which in this case
is FCh. And then test it for equality to recordChecksum which has a value
of FCh also.
Is there a C keyword that will allow me to drop(discard) all but the two
least significant digits of computedChecksum? Or is there better way to go
over this.
Thank you for any help you can extend to me.
Regards,
James
____________________________________________________________________
**** Get your free E-Mail account at WWW.DIGITELONE.COM ****
- Raw text -