The hexidecimal escape sequence is not specific to Microsoft. It's part of C/C++: http://en.cppreference.com/w/cpp/language/escape
Meaning that to assign a hexidecimal number to a char
, this is cross platform code:
char a = '\xD';
The question already demonstrates assigning a decimal number to a char
:
char a = 13;
And octal numbers can also be assigned as well, with only the escape switch:
char a = '\023';
Incidentally, '\0'
is common in C/C++ to represent the null-character (independent of platform). '\0'
is not a special character that can be escaped. That's actually invoking the octal escape sequence.