Posted by hussein on July 13, 1999 at 18:55:20:
In Reply to: testing posted by Chris Pizzurro on July 13, 1999 at 17:34:02:
: I am having some trouble testing all 256 characters.
: My for loop has been coded as follows:
: for (input='\x000'; input<='\x0FF'; input++ )
: At runtime this for loop does not execute. Does anyone
: know why?
you may have problems since you cannot
detect the end of the loop - this is because the
character data type has a maximum value of 0xff, and
when that value is incremented, it naturally wraps
around to 0, hence the problem of not being able to
distinguish between first and last again ...
a simple solution is to use a larger integer variable
for the loop control, and typecast whenever u need a
character
hope this helps ...
---
hussein