+ 1
How we can use byte operations?
Where we can use byte operations (like AND, OR, XOR)? How they are useful?
3 Réponses
+ 5
Did you mean bitwise operations? Bitwise operations is used to manipulate values for comparisons and calculations.
Common example are device drivers.(window uses those)
+ 2
bitwise operations are very useful in low-level programming, when speed and memory usage matter.
some things I used:
- setting or reading pins and ports of a microcontroller
- storing 8 booleans in one byte
- shifting an integer to the left/right multiplies/divides it by two for every shift
- forming byte array for communication (package) and calculating it's checksum
- and more...
generally, nobody forbids you to use it anywhere, but you must know what and why are you doing
+ 1
Yes, i mean bitwise operations, sorry for bad english.
Thanks for answering.