Hello,
If i try with BitConverter,it requires a byte array and i don't have that.I have a Int32 and i want to convert it to UInt32.
In C++ there was no problem with that.
Hello,
If i try with BitConverter,it requires a byte array and i don't have that.I have a Int32 and i want to convert it to UInt32.
In C++ there was no problem with that.
A simple cast is all you need. Since it's possible to lose precision doing this, the conversion is explicit.
long x = 10;
ulong y = (ulong)x;
To convert a long to a ulong, simply cast it:
long a;
ulong b = (ulong)a;
C# will throw an exception if it is a negative number.
Int32 i = 17;
UInt32 j = (UInt32)i;
EDIT: question is unclear whether you have a long or an int?