[comp.lang.c] How to write Trigraph like character sequences in a string

martin@mwtech.UUCP (Martin Weitzel) (05/30/91)

In article <RICHARD.91May29092137@lambda.iesd.auc.dk> richard@iesd.auc.dk (Richard Flamsholt S0rensen) writes:
>>>>>> On 28 May 91 23:12:53 GMT, bliss@sp64.csrd.uiuc.edu (Brian Bliss) said:

>> What if I want to use the sequence "??!" within a string?

>  puts("Too bad - it is impossible to use ??""! in a string  :-)");

puts("In fact, there is another impossible way to use ?\?! in a string  :-)");

puts("and what about 1) \??!");
puts("               2) ?""?!");
puts("               3) ?""?""!");
puts("               4) ??\!");

If you want to think a moment about which of the above could also work,
you now have the time (if your news-reader stops output on a formfeed).

I'm sure that 1) DOESN'T work (some books about ANSI-C are not aware
of this - they obviously didn't care about the phases of translation).
2) and 3) should work OK, where 3) is a lot to type and will usually
fall out of consideration; I'm not quite sure about 4) and I'm too lazy
to RTFAS (read the fine ANSI standard), since four ways to make the
impossible possible seem already to be enough.
-- 
Martin Weitzel, email: martin@mwtech.UUCP, voice: 49-(0)6151-6 56 83