What is the difference between 0x and '\x' in C++?
c++
Solution
For a character, both are quite equal.
But only one can be mixed into a string with other normal characters. `"ABC\x5A"`
And only one can be used to initialize a large integral type: `long long x = 0x1234567812345678LL;`
Problem
I know that hex-decimal number is usually prefixed with 0x in C/C++ language. For example, `0x5A` means 90 in decimal. But I saw an example code using single-quoted character with `'\x'`. ``` BYTE outputBuffer[index++] = '\x5A'; // instead of 0x5A ``` Is the meaning of `'\x5A'` exactly the same as `0x5A`? If so, why is there alternative way of hex-decimal notation?