C Programming : The “|=” Operator
I don't know C very much, and so I'd like to know what the “|=” operator means.
I can see it in this line for example :
host->flag |= 8;
'host' is a pointer to a structure and 'flag' is undefined in the code but probably already defined inside the host computer.
The code was taken from the “cracksome” file in the Morris worm's source code. If you want to see to whole source code, follow this link (it's a .txt
file so it's not going to run on your computer) : http://www.foo.be/docs-free/morris-worm/worm/cracksome.c.txt
Can you help me? I'd appreciate it a lot :-)
| is bitwise-or and |= works just like += or *= in that it takes the result of the bitwise-or and stores it into the variable that it performed it with.
TY! That was clear and helpful.
Topic archived. No new replies allowed.