T
The Last Danish Pastry
void Test(byte x, byte y)
{
byte z = x & y;
}
This gives an error: "Cannot implicitly convert type 'int' to 'byte'. An
explicit conversion exists (are you missing a cast?)"
But, in "& Operator (C# Reference)" we read...
Binary & operators are predefined for the integral types and bool.
In "Integral Types Table (C# Reference)" we see that byte is an "integral
type".
What is going on? Programmers have been anding together two bytes to get
another byte for decades.
{
byte z = x & y;
}
This gives an error: "Cannot implicitly convert type 'int' to 'byte'. An
explicit conversion exists (are you missing a cast?)"
But, in "& Operator (C# Reference)" we read...
Binary & operators are predefined for the integral types and bool.
In "Integral Types Table (C# Reference)" we see that byte is an "integral
type".
What is going on? Programmers have been anding together two bytes to get
another byte for decades.