+ operators

Renoir csharp at relhost.net
Sat Jun 11 14:54:25 PDT 2011


Sorry for the question but i'm an absolutely noob
I have:

byte x = 10;
byte y = 3;
x = x + y;

why compilers complains?

Error: cannot implicitly convert expression (cast(int)x + cast(int)
y
) of type int to byte

Have i to make another cast to sum byte + byte?


More information about the Digitalmars-d-learn mailing list