[Study Notes] [C Language] in hexadecimal notation, learning notes in notation
1. What is hexadecimal
It is a counting method, which is a numerical representation.
2. 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
3. Gossip
1> features: 0 ~ 7. Every 8 hours
2> writing format: starting with 0
3> mutual conversion between octal and binary
4. hexadecimal
1> features: 0 ~ F
2> writing format: starting with 0x or 0X
3> hexadecimal and Binary Conversion
5. the printf format is output in different hexadecimal formats.
1 # include <stdio. h> 2 3/* 4% d \ % I decimal form output integer 5% c output character 6% p output address 7% f output decimal form output integer 8% x hexadecimal form output integer 10 11 */12 13 int main () 14 {15 // by default, it is 16 int number = 12; 17 18 // binary (starting with 0b or 0B) 19 int number2 = 0B1100; 20 21 // octal (starting with 0) 22 int number3 = 014; 23 24 // hexadecimal (starting with 0x or 0X) 25 int number4 = 0xc; 26 27 // % d output a value in the form of a 10-digit integer 28 printf ("% x \ n", number); 29 30 return 0; 31}