INF: C Regards the Right Arrow Character (1Ah) as End of File

ID Number: Q63322

5.00 5.10 6.00 6.00a 6.00ax 7.00 | 5.10 6.00 6.00a

MS-DOS | OS/2

Summary:

In Microsoft C versions 5.1, 6.0, 6.0a, 6.0ax, and C/C++ version 7.0 the

right arrow character (1Ah) is read as an end-of-file (EOF) character,

even if it occurs nested within a character string.

More Information:

The unexpected EOF can be avoided by inserting an escape sequence

within the string to replace the right arrow character. Use the

following

printf("Hello""\x1a""world.");

instead of:

printf("Hello(right arrow character)world");

Using the proper format forces the compiler to recognize the hex 1A as

an escape sequence, instead of an EOF. If the escape sequence is not

separated from the rest of the string, it may be read as a different

hex value, because characters will appear directly after it. In

addition to hex values, an octal value may be used.

Additional reference words: 5.10 6.00 6.00a 6.00ax 7.00