C language-05 memory analysis,-05 Analysis

Source: Internet
Author: User

C language-05 memory analysis,-05 Analysis
1. hexadecimal 1. Binary

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

2> writing format: starting with 0b or 0b

3> usage: binary commands \ binary files. variables are stored in binary memory.

4> mutual conversion between binary and decimal

5> n is the data range that can be expressed by binary bits (negative number is not considered): 0 ~ The Npower of 2-1

 

2. Gossip

1> features: 0 ~ 7. Every 8 hours

2> writing format: starting with 0

3> mutual conversion between octal and binary

 

3. hexadecimal

1> features: 0 ~ F

2> writing format: starting with 0x or 0X

3> hexadecimal and Binary Conversion

4. Conclusion:

1> Use of calculators in Mac

2> printf outputs in different hexadecimal formats

 

# Include <stdio. h>/* % d \ % I in decimal form output integer % c output character % p output address % f output decimal % o in octal form output integer % x in hexadecimal form output integer * /int main () {// by default, it is a decimal int number = 12; // binary (starting with 0 B or 0 B) int number2 = 0B1100; // octal (starting with 0) int number3 = 014; // hexadecimal (starting with 0x or 0X) int number4 = 0xc; // % d outputs a value printf ("% x \ n ", number); return 0 ;}

 

Related Article

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.