By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,159 Members | 947 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,159 IT Pros & Developers. It's quick & easy.

Begginer question

P: n/a
I googled for it but found 0 results "|=" my question is:

what does |= do?

| is a bitwise or
= is equal
but what |= do?
I am using C not C++ if it makes any difference.

Nov 4 '06 #1
Share this Question
Share on Google+
4 Replies


P: n/a
fermineutron wrote:
I googled for it but found 0 results "|=" my question is:

what does |= do?

| is a bitwise or
= is equal
but what |= do?
I am using C not C++ if it makes any difference.
You should have a good C book. Then you should read the book.

--
Joe Wright
"Everything should be made as simple as possible, but not simpler."
--- Albert Einstein ---
Nov 4 '06 #2

P: n/a
fermineutron:
>| is a bitwise or
= is equal
but what |= do?
x = x + 5;
x += 5;

x = x | 5
x |= 5;

--

Frederick Gotham
Nov 4 '06 #3

P: n/a
Frederick Gotham wrote:
fermineutron:
| is a bitwise or
= is equal
but what |= do?

x = x + 5;
x += 5;

x = x | 5
x |= 5;
Thanks

Nov 4 '06 #4

P: n/a
"fermineutron" <fr**********@yahoo.comwrites:
I googled for it but found 0 results "|=" my question is:

what does |= do?

| is a bitwise or
= is equal
but what |= do?
Look up "compound assignment" in your C textbook or in the standard.

--
Keith Thompson (The_Other_Keith) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <* <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.
Nov 4 '06 #5

This discussion thread is closed

Replies have been disabled for this discussion.