Why does this compile:
char ch = \'1234\'; //no error
But not anything more than 4 chars :
char ch = \'12345\'
It's a multicharacter literal, and has a type of int.
C++11 §2.13.2 Character literals
A character literal is one or more characters enclosed in single quotes, as in
’x’, optionally preceded by the letterL, as inL’x’. A character literal that does not begin withLis an ordinary character literal, also referred to as a narrow-character literal. An ordinary character literal that contains a single c-char has type char, with value equal to the numerical value of the encoding of the c-char in the execution character set. An ordinary character literal that contains more than one c-char is a multicharacter literal. A multicharacter literal has typeintand implementation-defined value.