Notes on computers, programming and all the stuff
czwartek, 18 września 2014
String literals are weird (at least in C/C++)
Simple quiz: what is the length of this string "\xbadcafe"?
5 letters
4 letters
2 letters
1 letter
The correct answer is
d
, i.e. single letter. In C/C++ escape sequence "\x..." consumes all hexadecimal digits.
‹
›
Strona główna
Wyświetl wersję na komputer