What should this code output? Oddly enough, it compiles.

#include <iostream> int main() { std::cout << '/dd1s'; } 

Closed due to the fact that the essence of the question is incomprehensible by the participants Vladimir Martyanov , aleksandr barakin , Mstislav Pavlov , insolor , Saidolim 18 Jan '16 at 6:34 .

Try to write more detailed questions. To get an answer, explain what exactly you see the problem, how to reproduce it, what you want to get as a result, etc. Give an example that clearly demonstrates the problem. If the question can be reformulated according to the rules set out in the certificate , edit it .

  • I vote for closing this question as not relevant to the topic, because the answer to it can hardly be useful to anyone else. - aleksandr barakin
  • If you are given an exhaustive answer, mark it as correct (a daw opposite the selected answer). - Nicolas Chabanovsky

1 answer 1

'/dd1s' is a multi-character (multichar) literal , whose type is int .

Depending on the compiler implementation, the '/ dd1s' is converted to an int (for example, through overflow), and this int is output to stdout.

  • and in 8richnuyu system does not translate? - rjaa
  • no, why? in the octal system - this is for example '\0777' - Abyx
  • 16riches more accurate - rjaa
  • And in hexadecimal it is '\xdd1' - Abyx