J
jas_lx
The basic understanding of what bitwise operators (& ^ | >> << ) comes
fairly simple, as long as one has a fundamental understanding of bits,
bytes and binary.
Having done some Win32 programming in straight C, the Win32 API sends
windows messages to applications with various settings stored in bit
fields, in which case changing the settings of the message is a matter
of using the bitwise operators. This was a good practical example of
using bitwise operators.
However, in all of my programming endevours and studies (including the
K&R book, Data Structures books, Stroustrup's book, Petzold's book, and
various Linux programming books), I have yet to come across any really
good, practical examples of using bitwise operators.
With C, of all languages, it helps tremendously to have practical,
meaningful examples of using the various constructs. Let's face it, C
syntax is intitially non-intuitive, and it's paradigms (pointers,
dynamic memory allocation, bitwise operators, and the like), can be
confusing at times and a source of hard to detect bugs, even for
experienced programmers.
So, does anyone have good practical examples of using bitwise
operators?
fairly simple, as long as one has a fundamental understanding of bits,
bytes and binary.
Having done some Win32 programming in straight C, the Win32 API sends
windows messages to applications with various settings stored in bit
fields, in which case changing the settings of the message is a matter
of using the bitwise operators. This was a good practical example of
using bitwise operators.
However, in all of my programming endevours and studies (including the
K&R book, Data Structures books, Stroustrup's book, Petzold's book, and
various Linux programming books), I have yet to come across any really
good, practical examples of using bitwise operators.
With C, of all languages, it helps tremendously to have practical,
meaningful examples of using the various constructs. Let's face it, C
syntax is intitially non-intuitive, and it's paradigms (pointers,
dynamic memory allocation, bitwise operators, and the like), can be
confusing at times and a source of hard to detect bugs, even for
experienced programmers.
So, does anyone have good practical examples of using bitwise
operators?