Hi, does anyone have any trusted code for converting various 8/16/32/64-bit, 2s-complement, binary fields to native integers?
I am a relatively weak (actively learning) C++ programmer needing to convert 8/16/32/64-bit, 2s-complement, bit streams (not text representation) to Qt/C++ native numbers. The data stream I receive is highly variable. I will be cutting-out the 8, 16, 32, and 64-bit 2s complement fields from the data stream (as defined by the instructions inside the stream itself), then converting each 2s complement field to a native, C++ integer.
My intent is to create a cross-platform-supportive class that can act on each of the four bit lengths and provide a single (large) result that I then process natively, as needed.
Thank you for any trusted code you suggest.
Bookmarks