C语言中ASCII码是什么意思?
C语言中ASCII码是什么意思?
是一个字符表,一个字节的范围是0-255,每个数可以表示一个字符.计算机都是以1,0编码的,可以先取得二进制对应的10进制,再解析为对应的字符.
但128-255基本上没有被定义,用于以后扩展.
例如;
字符'a',的ASCII是97.
你可以做个是实验
chartmp = 97;
printf("%c,tmp);
在输出终端表示为a.
其他也一样.
以下是部分表
ASCII Table (7-bit)
(ASCII = American Standard Code for Information Interchange)
Decimal Octal HexBinary Value
------- ----- --------- -----
000000000 00000000NUL(Null char.)
001001001 00000001SOH(Start of Header)
002002002 00000010STX(Start of Text)
003003003 00000011ETX(End of Text)
004004004 00000100EOT(End of Transmission)
005005005 00000101ENQ(Enquiry)
006006006 00000110ACK(Acknowledgment)
007007007 00000111BEL(Bell)
008010008 00001000 BS(Backspace)
009011009 00001001 HT(Horizontal Tab)
01001200A 00001010 LF(Line Feed)
01101300B 00001011 VT(Vertical Tab)
01201400C 00001100 FF(Form Feed)
01301500D 00001101 CR(Carriage Return)
01401600E 00001110 SO(Shift Out)
01501700F 00001111 SI(Shift In)
016020010 00010000DLE(Data Link Escape)
017021011 00010001DC1 (XON) (Device Control 1)
018022012 00010010DC2 (Device Control 2)
019023013 00010011DC3 (XOFF)(Device Control 3)
020024014 00010100DC4 (Device Control 4)
021025015 00010101NAK(Negative Acknowledgement)
022026016 00010110SYN(Synchronous Idle)
023027017 00010111ETB(End of Trans. Block)
024030018 00011000CAN(Cancel)
025031019 00011001 EM(End of Medium)
02603201A 00011010SUB(Substitute)
02703301B 00011011ESC(Escape)
02803401C 00011100 FS(File Separator)
02903501D 00011101 GS(Group Separator)
03003601E 00011110 RS(Request to Send)(Record Separator)
03103701F 00011111 US(Unit Separator)
032040020 00100000 SP(Space)
033041021 00100001!(exclamation mark)
034042022 00100010"(double quote)
035043023 00100011#(number sign)
036044024 00100100$(dollar sign)
037045025 00100101%(percent)
038046026 00100110&(ampersand)
039047027 00100111'(single quote)
040050028 00101000((left/opening parenthesis)
041051029 00101001)(right/closing parenthesis)
04205202A 00101010*(asterisk)
04305302B 00101011+(plus)
04405402C 00101100,(comma)
04505502D 00101101-(minus or dash)
04605602E 00101110.(dot)
04705702F 00101111/(forward slash)
048060030 001100000
049061031 001100011
050062032 001100102
051063033 001100113
052064034 001101004
053065035 001101015
054066036 001101106
055067037 001101117
056070038 001110008
057071039 001110019
05807203A 00111010:(colon)
05907303B 00111011;(semi-colon)
06007403C 00111100 06107503D 00111101=(equal sign)
06207603E 00111110>(greater than)
06307703F 00111111?(question mark)
064100040 01000000@(AT symbol)
065101041 01000001A
066102042 01000010B
067103043 01000011C
068104044 01000100D
069105045 01000101E
070106046 01000110F
071107047 01000111G
072110048 01001000H
073111049 01001001I
07411204A 01001010J
07511304B 01001011K
07611404C 01001100L
07711504D 01001101M
07811604E 01001110N
07911704F 01001111O
080120050 01010000P
081121051 01010001Q
082122052 01010010R
083123053 01010011S
084124054 01010100T
085125055 01010101U
086126056 01010110V
087127057 01010111W
088130058 01011000X
089131059 01011001Y
09013205A 01011010Z
09113305B 01011011[(left/opening bracket)
09213405C 01011100\(back slash)
09313505D 01011101](right/closing bracket)
09413605E 01011110^(caret/circumflex)
09513705F 01011111_(underscore)
096140060 01100000`
097141061 01100001a
098142062 01100010b
099143063 01100011c
100144064 01100100d
101145065 01100101e
102146066 01100110f
103147067 01100111g
104150068 01101000h
105151069 01101001i
10615206A 01101010j
10715306B 01101011k
10815406C 01101100l
10915506D 01101101m
11015606E 01101110n
11115706F 01101111o
112160070 01110000p
113161071 01110001q
114162072 01110010r
115163073 01110011s
116164074 01110100t
117165075 01110101u
118166076 01110110v
119167077 01110111w
120170078 01111000x
121171079 01111001y
12217207A 01111010z
12317307B 01111011{(left/opening brace)
12417407C 01111100|(vertical bar)
12517507D 01111101}(right/closing brace)
12617607E 01111110~(tilde)
12717707F 01111111DEL(delete)