Namespaces
Variants
Actions

ASCII Chart

From cppreference.com
< cpp‎ | language
 
 
C++ language
General topics
Flow control
Conditional execution statements
Iteration statements (loops)
Jump statements
Functions
Function declaration
Lambda function expression
inline specifier
Dynamic exception specifications(until C++17*)
noexcept specifier(C++11)
Exceptions
Namespaces
Types
Specifiers
constexpr(C++11)
consteval(C++20)
constinit(C++20)
Storage duration specifiers
Initialization
Expressions
Alternative representations
Literals
Boolean - Integer - Floating-point
Character - String - nullptr(C++11)
User-defined(C++11)
Utilities
Attributes(C++11)
Types
typedef declaration
Type alias declaration(C++11)
Casts
Memory allocation
Classes
Class-specific function properties
Special member functions
Templates
Miscellaneous
 

The following chart contains all 128 ASCII decimal (dec), octal (oct), hexadecimal (hex) and character (ch) codes.

decocthexchdecocthexchdecocthexchdecocthexch
0000NUL (null)324020(space)6410040@9614060`
1101SOH (start of header)334121!6510141A9714161a
2202STX (start of text)344222"6610242B9814262b
3303ETX (end of text)354323#6710343C9914363c
4404EOT (end of transmission)364424$6810444D10014464d
5505ENQ (enquiry)374525%6910545E10114565e
6606ACK (acknowledge)384626&7010646F10214666f
7707BEL (bell)394727'7110747G10314767g
81008BS (backspace)405028(7211048H10415068h
91109HT (horizontal tab)415129)7311149I10515169i
10120aLF (line feed - new line)42522a*741124aJ1061526aj
11130bVT (vertical tab)43532b+751134bK1071536bk
12140cFF (form feed - new page)44542c,761144cL1081546cl
13150dCR (carriage return)45552d-771154dM1091556dm
14160eSO (shift out)46562e.781164eN1101566en
15170fSI (shift in)47572f/791174fO1111576fo
162010DLE (data link escape)48603008012050P11216070p
172111DC1 (device control 1)49613118112151Q11316171q
182212DC2 (device control 2)50623228212252R11416272r
192313DC3 (device control 3)51633338312353S11516373s
202414DC4 (device control 4)52643448412454T11616474t
212515NAK (negative acknowledge)53653558512555U11716575u
222616SYN (synchronous idle)54663668612656V11816676v
232717ETB (end of transmission block)55673778712757W11916777w
243018CAN (cancel)56703888813058X12017078x
253119EM (end of medium)57713998913159Y12117179y
26321aSUB (substitute)58723a:901325aZ1221727az
27331bESC (escape)59733b;911335b[1231737b{
28341cFS (file separator)60743c<921345c\ 1241747c|
29351dGS (group separator)61753d=931355d]1251757d}
30361eRS (record separator)62763e>941365e^1261767e~
31371fUS (unit separator)63773f?951375f_1271777fDEL (delete)

Note: in Unicode, the ASCII character block is known as U+0000..U+007F Basic Latin.

[edit]Example

#include <iostream>   int main(){std::cout<<"Printable ASCII [32..126]:\n";for(char c{' '}; c <='~';++c)std::cout<< c <<((c +1)%32?' ':'\n');std::cout<<'\n';}

Possible output:

Printable ASCII [32..126]:  ! " # $ % & ' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 : ; < = > ? @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z [ \ ] ^ _ ` a b c d e f g h i j k l m n o p q r s t u v w x y z { | } ~

[edit]See also

C documentation for ASCII Chart
close