32 bit integer from sbyte array
-
I have an sbyte array with a length of 4. What these four bytes represent is a single 32-bit number. I don't know how to convert the 4 sbyte elements into a single 32-bit number in C#. I could do this easily in C or C++ by casting a pointer to the first element as a pointer to Long and then dereferencing the pointer to get at the long. How do I do this in C#? BRCKCC
-
I have an sbyte array with a length of 4. What these four bytes represent is a single 32-bit number. I don't know how to convert the 4 sbyte elements into a single 32-bit number in C#. I could do this easily in C or C++ by casting a pointer to the first element as a pointer to Long and then dereferencing the pointer to get at the long. How do I do this in C#? BRCKCC
-
I have an sbyte array with a length of 4. What these four bytes represent is a single 32-bit number. I don't know how to convert the 4 sbyte elements into a single 32-bit number in C#. I could do this easily in C or C++ by casting a pointer to the first element as a pointer to Long and then dereferencing the pointer to get at the long. How do I do this in C#? BRCKCC
Use the shift operator >> to move the individual values to the right place, then add them. If you're not familiar with it, read this page: http://www.c-sharpcorner.com/Language/BitWiserOpsInCSCH001.asp[^] Christian I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer