"Learning Notes", "C language" in the system

Source: Internet
Author: User

1. What is a binary

is a way of counting, a representation of a number

2. Binary

1> features: only 0 and 1, every 2 into 1

2> writing format: 0b or 0b start

3> application: Binary instruction \ Binary, variable in memory is binary storage

4> Binary and Decimal conversions

5> N is the range of data that bits can represent (regardless of negative numbers): 0~2 N-square-1

3. Eight binary

1> Features: 0~7, every eight into a

2> writing format: 0 opening

3> octal binary and binary conversion

4.16 Binary

1> Features: 0~f, every 16 into a

2> writing format: 0x or 0X start

3> 16 binary and binary conversion

5. Format printf output in a different binary form

1#include <stdio.h>2 3 /*4 %d\%i output integer in decimal form5 %c Output Character6 %p Output Address7 %f Output Decimal8 %o Output integer in octal form9 %x 16 in binary form output integerTen   One  */ A  - intMain () - { the     //By default, it is the decimal -     intNumber = A; -      -     //Binary (0b or 0B start) +     intNumber2 =0b1100; -      +     //octal (0 start) A     intNumber3 =014; at      -     //16 binary (0x or 0X start) -     intNumber4 =0xc; -      -     //%d outputs a numeric value as a 10-binary integer -printf"%x\n", number); in      -     return 0; to}

"Learning Notes", "C language" in the system

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.