deleyd
asked on
ushort bitmask "cannot implicitly convert type 'int' to 'ushort'
I can do this:
I try throwing in casts but Visual Studio still complains:
ushort x = 0xFFFF;
ushort y = x;
y &= 0x01FF;
but I can't do this:
ushort y = x & 0x01FF;
I get the error: Cannot implicitly convert type 'int' to 'ushort'. An explicit conversion exists (are you missing a cast?)I try throwing in casts but Visual Studio still complains:
ushort y = (ushort)x & (ushort)0x01FF;
What is the proper syntax for this?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.