delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2001/03/17/23:38:53

From: "James Allan Ventura" <javentura AT digitelone DOT com>
Subject: Newbie question: Need help finding a particular C keyword
To: djgpp AT delorie DOT com
X-Mailer: CommuniGate Pro Web Mailer v.3.2.4
Date: Sun, 18 Mar 2001 12:40:32 +0800
Message-ID: <web-11124443@digitelone.com>
MIME-Version: 1.0
Reply-To: djgpp AT delorie DOT com

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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019