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 ;}