W
William L. Bahn
ozbear said:Hmmm... dunno where the '\' went but indeed it was a typo.
Using the unadorned 0 is a better idea, at least in this case.
Thanks for the correction.
This can be argued both ways:
IF the goal is to write code based on defined behavior (as
opposed to defined implementation), then mychar = 0 should be
avoided because it relies on a detailed knowledge of the
implementation requirements for the NUL character.
HOWEVER, by using that knowledge (which the next person reading
the code may not have) an easy to make and hard to find logic
error can be avoided.