Fork501
Freshman
Hi, all
I've been programming in C#/C++ for a few years and keep running into these weird operators (I hope I'm using the right term) that I have never found out what they are.
Here's a list of some:
|
>>=
|=
I'm working with some Home Automation products, which require me to do some programming through the COM port and can't figure out why some of the examples I found use these when working with bytes.
Here's a few examples of what I found:
I'm a firm believer in NOT stealing code and I can't learn from this code if I can't understand what the syntaxes even mean!
Can anyone help shed some light?
The above lines of code are from an open-source VC++ project on CodeProject.
Thanks in advance!
~Derek
I've been programming in C#/C++ for a few years and keep running into these weird operators (I hope I'm using the right term) that I have never found out what they are.
Here's a list of some:
|
>>=
|=
I'm working with some Home Automation products, which require me to do some programming through the COM port and can't figure out why some of the examples I found use these when working with bytes.
Here's a few examples of what I found:
Code:
BYTE hc;
hc|= 0x4;
Code:
for (BYTE bBit = 0x80;bBit > 0;bBit >>= 1)
{
Code:
BYTE hc;
hc = houseCodes[(BYTE(cHouseCode) | 0x20) - 'a'];
I'm a firm believer in NOT stealing code and I can't learn from this code if I can't understand what the syntaxes even mean!
Can anyone help shed some light?
The above lines of code are from an open-source VC++ project on CodeProject.
Thanks in advance!
~Derek