how to split a variable data??

For questions and comments on programming in general. And for any items that don't fit into the forums below.

Moderators: Benj, Mods

Post Reply
kg300
Posts: 31
Joined: Thu May 31, 2018 6:25 am
Has thanked: 5 times
Been thanked: 1 time
Contact:

how to split a variable data??

Post by kg300 »

If X= FF B0 FC FE
So how can I split into?
A=FC FE
B= B0
C= FF

kersing
Valued Contributor
Valued Contributor
Posts: 2045
Joined: Wed Aug 27, 2008 10:31 pm
Location: Netherlands
Has thanked: 553 times
Been thanked: 1081 times
Contact:

Re: how to split a variable data??

Post by kersing »

A = X & 0xFFFF
B = ( X >> 16 ) & 0xFF
C = ( X >> 24 ) & 0xFF
“Integrity is doing the right thing, even when no one is watching.”

― C.S. Lewis

kg300
Posts: 31
Joined: Thu May 31, 2018 6:25 am
Has thanked: 5 times
Been thanked: 1 time
Contact:

Re: how to split a variable data??

Post by kg300 »

kersing wrote:
Sat Feb 06, 2021 12:15 pm
A = X & 0xFFFF
B = ( X >> 16 ) & 0xFF
C = ( X >> 24 ) & 0xFF
thanks "kersing " :)

Post Reply