given the following Code:
byte x, xmin, xmax, xstep;
x = (x + xstep < xmax ? x + xstep : xmax)
the compiler tells me
Cannot implicitly convert type 'int' to 'byte'. An explicit conversion exists (are you missing a cast?)
Where does the conversion from byte to int happen? And why?
Adding a
byteto abyteresults in anint, according to the MSDN: