Escape sequence | Combination of characters
Definition:
The escape sequence are the combination of special characters which is used for format the output result. These are only used to format our output result not input.The general syntax of apply the escape sequence is :
#include <iostream>
using namespace std;
void main () {
cout<<"\t \t .....Ali Haider's
program....."<<endl<<endl<<endl;
cout<<"Thank you for check my program.
"<<endl<<endl<<endl;
}
(Here \t is used for Tab)
These are some of the escape sequence of C++ as under :
Escape
sequence |
Description
|
Representation
|
\'
|
single
quote
|
byte
0x27 in ASCII encoding
|
\"
|
double
quote
|
byte 0x22 in ASCII encoding
|
\?
|
question
mark
|
byte
0x3f in ASCII encoding
|
\\
|
backslash
|
byte 0x5c in ASCII encoding
|
\a
|
audible
bell
|
byte
0x07 in ASCII encoding
|
\b
|
backspace
|
byte 0x08 in ASCII encoding
|
\f
|
form
feed - new page
|
byte
0x0c in ASCII encoding
|
\n
|
line
feed - new line
|
byte 0x0a in ASCII encoding
|
\r
|
carriage
return
|
byte
0x0d in ASCII encoding
|
\t
|
horizontal
tab
|
byte 0x09 in ASCII encoding
|
\v
|
vertical
tab
|
byte
0x0b in ASCII encoding
|
\nnn
|
arbitrary
octal value
|
byte nnn
|
\xnn
|
arbitrary
hexadecimal value
|
byte
nn
|
\unnnn
|
arbitrary
Unicode value.
May result in several characters. |
code
point U+nnnn
|
\Unnnnnnnn
|
arbitrary
Unicode value.
May result in several characters. |
code
point U+nnnnnnnn
|
Comments
Post a Comment