[cfe-dev] confusion with character types

Jochen Wilhelmy j.wilhelmy at arcor.de
Thu Oct 14 06:48:19 PDT 2010


>  That seems to me to be the better interpretation.  Specifically, it
>  would be surprising (to me) if
>
>	std::cout<<  "Hello world"<<  '\n';
>
>  caused "Hello world10" to be displayed.

Your reply shows that the topic is indeed confusing.
As '\n' in your example is of type char and neither of
type signed char nor of type unsigned char, it would
result in the correct output ("Hello world\n")
even if signed char (int8_t) and unsigned char (uint8_t)
are treated as numbers.

-Jochen





More information about the cfe-dev mailing list