char ch = 'a';
std::cout << ch << '
';
std::cout << +ch << '
';
The first insertion writes the character a
to cout
. The second insertion writes the numeric value of ch
to cout
. But that's a bit obscure; it relies on the compiler applying integral promotions for the +
operator.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…