ITP 165x Lecture 25: Bitwise Operators

54 views2 pages

Document Summary

Itp 165: intro to c++ - lecture 25: bitwise operators. Bitwise operators operate on each bit of binary number(s) in a specific way. We will cover 4 different bitwise operators in c++: Bitwise not operates on a single number, whereas and, or, xor operate between two numbers. Bitwise not flips every bit in a single binary number. So something that was previously a 0 will instead be a 1, and viceversa. In a bitwise and, you line up the binary digits of two numbers. Any places that are a 1 in both numbers are a 1 in the result. In a bitwise or, you line up the binary digits of two numbers. Any places that are a 1 in either of the numbers are a 1 in the result. In a bitwise xor (exclusive or), you line up the binary digits of two numbers.

Get access

Grade+
$40 USD/m
Billed monthly
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
10 Verified Answers
Class+
$30 USD/m
Billed monthly
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
7 Verified Answers

Related Documents