Path: utzoo!censor!geac!torsqnt!news-server.csri.toronto.edu!rutgers!netnews.upenn.edu!eniac.seas.upenn.edu!weisen From: weisen@eniac.seas.upenn.edu (Neil Weisenfeld) Newsgroups: comp.sys.ibm.pc.programmer Subject: Re: (fairly minor) bug in Microsoft C V6 Keywords: Microsoft C V6, bug Message-ID: <26971@netnews.upenn.edu> Date: 11 Jul 90 22:57:09 GMT References: <1829@ns-mx.uiowa.edu> Sender: news@netnews.upenn.edu Reply-To: weisen@eniac.seas.upenn.edu.UUCP (Neil Weisenfeld) Organization: University of Pennsylvania Lines: 38 In article <1829@ns-mx.uiowa.edu> cmdglv@vaxa.weeg.uiowa.edu writes: > > Here's a fun little bug that I just discovered in Microsoft C V6.0. >When I run the following program: > > #include > void main() { > printf("Question marks: '??'"); > } > >I get the following output: > > Question marks: '^ > > It's not quite what I expected. And it breaks a whole series of >programs I have that use quoted question marks within strings :( > >P.S., Does anybody else out there resent being patronized, belittled, and >disbelieved when they try to report a bug to Microsoft Technical Support? > MS Tech support probably receives much more than its share of "bug" reports. What you have stumbled upon is not a bug, it is a feature. Since not all terminals (outside of the UNIX/C/DEC,SUN,AT&T world) can do all of the characters required by C, the ANSI standard provides a method for specifying certain characters by sequences known as trigraphs. All trigraphs begin with a ??. The trigraph for ^ is (yes, you guessed it) ??'. See A12.1 of K&R 2nd Ed. Neil =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= Neil I. Weisenfeld | InterNet: weisen@eniac.seas.upenn.edu Dept. of Computer and Info. Sciences | USPS: I dunno, I'm moving... University of Pennsylvania | PENNmail: Don't even try it... =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=