--- 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;
