“Greg Laird” <glaird@teleport.com> wrote in message
news:3a82b340.3060378@inn.qnx.com…
Hello,
Can anyone tell me why, when executing the following program:
#include <stdio.h
main()
{
printf("(??)\n");
return;
}
The following is printed:
(]
in case this is hard to read, the program prints two characters, the
‘(’ left paren and the ‘]’ right bracket.
Is there some sort of preprocessor operator that I don’t know about
that operates within strings?
lol ! good question i won several bottles of beer asking it
if seriously this is from watcom help (winnt vetsion)
Trigraphs
The following is the list of trigraphs. In a C source file, all occurrences
(including inside quoted strings and character constants) of any of the
trigraph sequences below are replaced by the corresponding single character.
Trigraph
Character Sequence
[ ??(
] ??)
{ ??<
} ??>
| ??!
??=
\ ??/
^ ??’
~ ??-
No other trigraphs exist. Any question mark (?) that does not belong to one
of the trigraphs is not changed.
To get a sequence of characters that would otherwise be a trigraph, place a
\ before the second question mark. This will cause the trigraph to be
broken up so that it is not recognized, but later in the translation
process, the ? will be converted to ?. For example, ??= will be
translated to ??=.
Thanks for your insight,
Greg Laird
Ian Zagorskih
Novosoft CyBearNet Department
Custom software development and web design since 1992
E-mail: ianzag@novosoft.ru
Phone: +7 (3832) 39-72-60, 39-72-61
Fax: +7 (3832) 39-63-58
For more visit www.novosoft-us.com