Path: utzoo!attcan!uunet!ncrlnk!ncr-sd!hp-sdd!hplabs!decwrl!labrea!rutgers!mailrus!cornell!batcomputer!sun.soe.clarkson.edu!spam From: spam@clutx.clarkson.edu (Spam,,,) Newsgroups: comp.sys.ibm.pc Subject: Turbo C 2.0 weirdities Message-ID: <1924@sun.soe.clarkson.edu> Date: 11 Dec 88 20:51:49 GMT Sender: news@sun.soe.clarkson.edu Lines: 24 While debugging what appeared to be a perfectly legit piece of code, I noticed that a) some variables were ignoring commands that changed their values, and b) that some variables changed values in commands that did not reference them at all! More specifically: 1) While calling one function, a variable utterly ignored a command that should have set it to zero. I was watching the variable in trace mode, and it kept its value. 2) While executing a sscanf, another variable changed that wasn't referenced at all. The sscanf worked fine on the variables it did reference. I was parsing an input line of hex numbers that was terminated by a '$'. I then did a sscanf(line,"%X %[^$]",&token, line) which chopped off the first hex number and assigned the rest to itself (w/o the $). I see no reason why this should change another variable to -1. Any suggestions? _______________________ Roger Gonzalez Clarkson University spam@clutx.clarkson.edu