[cfe-dev] confusion with character types

Jochen Wilhelmy j.wilhelmy at arcor.de
Thu Oct 14 07:12:33 PDT 2010


>But would it be better if this gave a different result?
>
>	signed char n = '\n';
>	std::cout<<  "Hello world"<<  n;

of course ;-)
these are equivalent:
signed char n = '\n';
int8_t n = '\n';
int8_t n = 10;

therefore I would expect "Hello world10".

it's the same as this being different:
float n  = '\n';
std::cout<<  "Hello world"<<  n;





More information about the cfe-dev mailing list