16
byte + byte = int ... ¿por qué?
Mirando este código C #: byte x = 1; byte y = 2; byte z = x + y; // ERROR: Cannot implicitly convert type 'int' to 'byte' El resultado de cualquier matemática realizada en byte(o short) tipos se devuelve implícitamente a un entero. La solución es devolver explícitamente el …
365
c#
type-conversion