Trigraph sequences

Some characters from the C and C++ character set are not available in all environments. You can enter these characters into a C or C++ source program using a sequence of three characters called a trigraph. The trigraph sequences are:

Trigraph Single character Description
??= # pound sign
??( [ left bracket
??) ] right bracket
??< { left brace
??> } right brace
??/ \ backslash
??' caret
??! | vertical bar
??- ~ tilde
The preprocessor replaces trigraph sequences with the corresponding single-character representation. For example,
some_array??(i??) = n;
Represents:
some_array[i] = n;

Begin z/OS onlyAt compile time, the compiler translates the trigraphs found in string literals and character constants into the appropriate characters they represent. These characters are in the coded character set you select by using the LOCALE compiler option. If you do not specify the LOCALE option, the preprocessor uses code page IBM-1047.

The z/OS® XL C/C++ compiler will compile source files that were edited using different encoding of character sets. However, they might not compile cleanly. z/OS XL C/C++ does not compile source files that you edit with the following:
  • A character set that does not support all the characters that are specified above, even if the compiler can access those characters by a trigraph.
  • A character set for which no one-to-one mapping exists between it and the character set above.
Note: The exclamation mark (!) is a variant character. Its recognition depends on whether or not the LOCALE option is active. For more information on variant characters, refer to the z/OS XL C/C++ Programming Guide.End z/OS only