How to write Trigraph like character sequences in a string (was:Re: to "OR" or not to "OR")
Martin Weitzel
martin at mwtech.UUCP
Thu May 30 21:26:15 AEST 1991
In article <RICHARD.91May29092137 at lambda.iesd.auc.dk> richard at iesd.auc.dk (Richard Flamsholt S0rensen) writes:
>>>>>> On 28 May 91 23:12:53 GMT, bliss at 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 at mwtech.UUCP, voice: 49-(0)6151-6 56 83
More information about the Comp.lang.c
mailing list