W
William Stacey
Put something like the following in your Global library and make em public
static or what ever you like:
You could also use sizeof(), but you need to use unsafe context for that, so
marshal works for this without needing unsafe.
int bitsInByte = Marshal.SizeOf(typeof(byte)) * 8;
int bitsInInt = Marshal.SizeOf(typeof(int)) * 8;
int bitsInLong = Marshal.SizeOf(typeof(long)) * 8;
Console.WriteLine("Bits in byte:"+bitsInByte);
Console.WriteLine("Bits in Int:"+bitsInInt);
Console.WriteLine("Bits in Long:"+bitsInLong);
static or what ever you like:
You could also use sizeof(), but you need to use unsafe context for that, so
marshal works for this without needing unsafe.
int bitsInByte = Marshal.SizeOf(typeof(byte)) * 8;
int bitsInInt = Marshal.SizeOf(typeof(int)) * 8;
int bitsInLong = Marshal.SizeOf(typeof(long)) * 8;
Console.WriteLine("Bits in byte:"+bitsInByte);
Console.WriteLine("Bits in Int:"+bitsInInt);
Console.WriteLine("Bits in Long:"+bitsInLong);