Urgent - Split Long into 2 Int using BitShift

Pay more attention to your data types.
BTW, with 32 bit data types, a one-in-a-million chance means you have over 4000 chances to screw up!

Sorry but as I'm a noob in programming I have difficults to understand some things. Also english is not my language so... ::slight_smile:

Now I understand that variable are 32 bit long, this means that I can use Bitshift but in different way ?

because both L & H & ValueLong are signed, 1111...11 will read as -1 for all three of them. Bitwise it is a correct split.

Another way to split your long is to use an union, a less used construct in C++, A union has multiple var's mapped upon the same memory space:

I'll try with Union code, thanks for it, but I dont understand why bitshift did non work or I dont understand how to correctly read the variable sent