(WIP) C Language Knowledge recall (by quqi99)

Source: Internet
Author: User

Zhang Hua posted: 2016-02-19Copyright Notice: can be reproduced freely. When reproduced, please be sure to indicate the original source and author information and this copyright notice in the form of a hyperlink .(http://blog.csdn.net/quqi99)
-bit Operation&: With operation, both 1 is 1, otherwise 0
|: or action. There is a 1 for 1, otherwise 0
^: XOR or operation, the difference is 1, otherwise 0
~: Reverse, place 1 to 0, 0 to 1
<<: shift left, e.g. 0000 <<3 = 0100 0000, shift left one equals to 2
>>: Shift left, such as: 0000 1000>>3=0000 0001, shift right one equivalent to descending to 2

The proportions are as follows:
Reg |= (1<<n), the nth position of Reg 1 (where 1 is represented as: 0000 0001)
Reg | = (1<< 7) | (1<< 4) | (1<< 0), 8th, 5 and 1 position 1 will be set
Reg &= (1<<n), place reg Nth Position 0

(WIP) C Language Knowledge recall (by quqi99)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.