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