D Drew Apr 14, 2004 #1 How do I get the "last 16 bits" from a 32 bit integer using C#? (I guess this means the right most 16 bits?) Regards, Drew
How do I get the "last 16 bits" from a 32 bit integer using C#? (I guess this means the right most 16 bits?) Regards, Drew
B bob holder Apr 14, 2004 #2 Drew said: How do I get the "last 16 bits" from a 32 bit integer using C#? (I guess this means the right most 16 bits?) Regards, Drew Click to expand... BitConverter.GetBytes(int32) Will return an array of 4 bytes.
Drew said: How do I get the "last 16 bits" from a 32 bit integer using C#? (I guess this means the right most 16 bits?) Regards, Drew Click to expand... BitConverter.GetBytes(int32) Will return an array of 4 bytes.
J Jon Skeet [C# MVP] Apr 14, 2004 #3 Drew said: How do I get the "last 16 bits" from a 32 bit integer using C#? (I guess this means the right most 16 bits?) Click to expand... Well, if you mean the least significant ones: int x = y & 0xffff;
Drew said: How do I get the "last 16 bits" from a 32 bit integer using C#? (I guess this means the right most 16 bits?) Click to expand... Well, if you mean the least significant ones: int x = y & 0xffff;