Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!uunet!decwrl!deccrl!news.crl.dec.com!nntpd.lkg.dec.com!tkou02.enet.dec.com!jit533!diamond From: diamond@jit533.swstokyo.dec.com (Norman Diamond) Newsgroups: comp.std.c Subject: Re: How to write Trigraph like character sequences in a string (was: Re: to "OR" or not to "OR") Message-ID: <1991Jun3.011539.17430@tkou02.enet.dec.com> Date: 3 Jun 91 01:15:39 GMT References: <1991May28.191122.15749@ncsu.edu> <1991May28.210421.9656@unlv.edu> <1991May28.231253.5226@csrd.uiuc.edu> <1991May31.014720.2477@tkou02.enet.dec.com> <1991May31.133330.1149@roundup.crhc.uiuc.edu> Sender: usenet@tkou02.enet.dec.com (USENET News System) Reply-To: diamond@jit533.enet@tkou02.enet.dec.com (Norman Diamond) Organization: Digital Equipment Corporation Japan , Tokyo Lines: 24 Attribution lost (Mr. Weizel, I think): >>>puts(" 4) ??\!"); >>>2) and 3) should work OK, [...] I'm not quite sure about 4) My mistake: >>It works. [and another mixed pair, see below] In article <1991May31.133330.1149@roundup.crhc.uiuc.edu> steven@pacific.csl.uiuc.edu writes: >(4) is not guaranteed to work because '\!' is not a valid ANSI escape. The >result of using '\!' (or any other invalid escape sequence) is undefined. Right, sorry. And my other mistake, puts(" 6) ????/!"); is not guaranteed to work either, but puts(" 7) ???/?!"); is. And if you need trigraphs in the first place, then (7) is the ONLY dependable way of obtaining the originally requested character sequence. (Though again, string concatenation still works if you don't need the two-question-marks-and-a-bang at preprocessing time.) -- Norman Diamond diamond@tkov50.enet.dec.com If this were the company's opinion, I wouldn't be allowed to post it. Permission is granted to feel this signature, but not to look at it.