课程: Complete Guide to C Programming Foundations
今天就学习课程吧!
今天就开通帐号,24,100 门业界名师课程任您挑!
Understanding bitwise operators - C教程
课程: Complete Guide to C Programming Foundations
Understanding bitwise operators
- [Instructor] The C language has six Bitwise Operators that work with integer values to manipulate them at the binary level. The four covered in this video are Bitwise AND:&, Bitwise Inclusive OR: |, Bitwise Exclusive OR: ^, and the One's compliment:~. Be aware that the carrot or hat character is the Bitwise exclusive OR operator. In many programming languages, this is the power or exponentiation operator, not so in C, which uses a function to raise a value to a specific power. To demonstrate how these Bitwise Operators work, I'm using a function in the exercise files called binString. It takes an integer value as input and returns a string of ones and zeros to represent bits in a value. The main function demonstrates the Bitwise AND Operator at line 28. Like its logical operator counterpart, the Bitwise AND test is true only when both bits at the same position in a value are set, or they're equal to one. The hexa decimal values tested or assigned lines 23 and 24. Run the program…
内容
-
-
-
-
-
Working with math operators3 分钟 13 秒
-
(已锁定)
Challenge: Do some math50 秒
-
(已锁定)
Solution: Do some math1 分钟 47 秒
-
(已锁定)
Using assignment operators1 分钟 49 秒
-
(已锁定)
Obeying the order of precedence3 分钟 14 秒
-
(已锁定)
Challenge: Get the order correct55 秒
-
(已锁定)
Solution: Get the order correct1 分钟 37 秒
-
(已锁定)
Working with relational operators3 分钟 48 秒
-
(已锁定)
Using logical operators3 分钟 58 秒
-
(已锁定)
Understanding bitwise operators3 分钟 44 秒
-
(已锁定)
Shifting bits3 分钟 13 秒
-
(已锁定)
Exploring unary operators3 分钟 3 秒
-
Chapter challenge: More math1 分钟 8 秒
-
(已锁定)
Chapter solution: More math2 分钟 45 秒
-
-
-
-
-
-
-
-
-