Question about iteger literals

Uranuz via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sun Jun 22 03:58:04 PDT 2014


In expression
      return c - 'a' + 10;
I could think that 10 has type int and resulting value promoted 
to the largest type. But I don't understand why in expression 
where both of arguments have type char:
	return c - '0';
I have resulting type int. It's very strange for me and looks 
very buggy)


More information about the Digitalmars-d-learn mailing list