Path: utzoo!attcan!uunet!wuarchive!decwrl!shelby!portia!hobbes From: hobbes@portia.Stanford.EDU (Andrew Zimmerman) Newsgroups: comp.sys.ibm.pc Subject: Re: TurboC, wanderer, and Zenith Supersport Summary: Correction Message-ID: <6974@portia.Stanford.EDU> Date: 24 Nov 89 07:12:58 GMT References: <6973@portia.Stanford.EDU> Sender: Andrew Zimmerman Organization: Stanford University Lines: 26 In article <6973@portia.Stanford.EDU>, hobbes@portia.Stanford.EDU (Andrew Zimmerman) writes: > Turbo C: > Is there a bug in the >> operator in Turbo C? The following > section of code doesn't seem to work (Turbo C 2.0) > > long value, shift; > > value = 0x8000; > for(shift=0; shift < 32; shift++) > { > printf("%08X\n",value >> shift); > } > Seems to work fine if shift is an int. (I know, I could do a (int) in front > of the shift, I just think that it should work without one.) > Sorry about the above program. As one individual pointed out to me, I have the wrong format in the print statement. It should have been lX, in which case it works just fine. (Thats what you get when you use the scanf formats in a printf statement (X is for a long in scanf, but is for an int in printf)) Andrew zimmer@calvin.stanford.edu hobbes@portia.stanford.edu