>But the following does the same thing and is also safe, and is what I think >you should use: it doesn't really matter, just makes it quicker coding. :)
Thanks, Tyler Littlefield Web: tysdomain.com email: [email protected] My programs don't have bugs, they're called randomly added features. ----- Original Message ----- From: John Matthews To: [email protected] Sent: Saturday, March 21, 2009 7:57 AM Subject: [c-prog] Re: Bit Operator --- In [email protected], Satya Prasad <satya_prakash_pra...@...> wrote: > > Is it safe to refer same variables in LHS and RHS while using Bitwise operators. Like: > > int x = 0 ; > int y = 0; > x = x | y; Yes, that is safe. Perhaps you are thinking of expressions such as: x = x++ | y; which isn't safe - see http://c-faq.com/expr/index.html But the following does the same thing and is also safe, and is what I think you should use: x |= y; [Non-text portions of this message have been removed]
