Talk:Bitwise operations in C

From Wikipedia, the free encyclopedia
Jump to: navigation, search
WikiProject C/C++  
WikiProject icon This article is within the scope of WikiProject C/C++, a collaborative effort to improve the coverage of C/C++ on Wikipedia. If you would like to participate, please visit the project page, where you can join the discussion and see a list of open tasks.
 ???  This article has not yet received a rating on the quality scale.
 ???  This article has not yet received a rating on the importance scale.


This page is under development. We feel that a page on bitwise operations detailing only in C-programming language needs an independent page. Please co-operate. Any discussions or any suggestions are respectfully welcomed. Please write them here. Thakarepiyush (talk) 14:27, 15 September 2011 (UTC)

Hi. Thanks, this article was helpful. I've never seen the term "EX-OR" used anywhere else though. I think "XOR" is the standard. — Preceding unsigned comment added by (talk) 15:59, 25 November 2012 (UTC)

Thanks for creating this page. Just wanted to mention that the first External Link seems to be broken. — Preceding unsigned comment added by (talk) 16:03, 30 May 2013 (UTC)

This page is very useful, but could you explain this example a little more:

 If the variable ch contains the bit pattern 11100101, then ch >> 1 will give the output as 11110010, and ch >> 2 will give 01111001.

What happens to the bits shifted in on the left? Why does ch >> 1 leave a 1 on the left, but ch >> 2 leaves a 0? And what does "unsigned type" mean? — Preceding unsigned comment added by (talk) 10:26, 15 January 2014 (UTC)

Confusing Intro[edit]

"Bitwise operations are contrasted by byte-level operations which characterize the bitwise operators' logical counterparts, the AND, OR and NOT operators." So is AND, OR, and NOT bitwise, bytewise (whatever the official, fancy name for that is anyway), or both? it's not all that clear in the intro (talk) 14:55, 26 May 2015 (UTC)

Agreed. The intro is disappointingly confusing and wrong. First off, C's bitwise operators can operate on any integral type, not just bytes. The distinction the writer is trying to make is whether the operator applies the logic operation to each bit in the arguments individually, or instead treats each argument as a single true/false value. The latter corresponds to the AND, OR etc referred to, though they are not called AND and OR etc in C, they are &&, || and so on. It is true that C has no operator that operates on two single-bit arguments, because there's no single-bit data type. This is generally not a problem as the bitwise operators can be used in a way which singles out a particular bit. Gwideman (talk) 06:43, 18 May 2016 (UTC)

Nominating Section 5 for deletion[edit]

What if anything does section 5 signify? And if you think it might be useful to someone, then what is the example program trying demonstrate? Kotika98 (talk) 03:59, 3 April 2016 (UTC)