0

Regarding C programming language, the descriptions of escape sequence does not resolve the output of following line in visual studio 2008.

char * str = "??/abc";
printf( "%s", str );

it prints only "bc".
Checking the memory pointed by str, we can find that "??/a" is working as "\a"

Searching on google we can't find anything related to "??/" being treated as backslash.

Raj
  • 3
  • 1
  • possible duplicate of [Why is "\?" an escape sequence in C/C++?](http://stackoverflow.com/questions/19374878/why-is-an-escape-sequence-in-c-c) –  Feb 26 '15 at 15:55

1 Answers1

1

To expand on AProgrammer's comment, C defines a set of trigraphs for people whose keyboards are missing certain characters. These begin with '??', followed by another character. In particular, '??/' is the trigraph for '\'.

This translation is done very early on in the complilation process, so the compiler just sees '\a'.

See MSDN

Simon B
  • 232
  • 6
  • 14