You use the multi-character literal 'ABC' to initialize an int .
How a multi-character literal is interpreted (which is an unusual way of using '' ) is determined by the implementation. In particular, the order of individual characters in an int interpretation is determined by the implementation.
There is no portable (i.e. implementation independent) way of predicting what this program will do in terms of character order in 'ABC' .
From the standard (C ++ 11, Β§2.14.3 / 1):
[...] A multichannel literal is of type int and has a value defined by the implementation.
source share