Lecture 1.4 Escape Sequence.pdf

MianSaeedAkbar1 134 views 4 slides Apr 05, 2023
Slide 1
Slide 1 of 4
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4

About This Presentation

Lecture 1.4 Escape Sequence in C++


Slide Content

ESCAPE SEQUENCE
Lecture 1.4
Prepared by: MianSaeed Akbar
REF:

ESCAPE SEQUENCE
An escape sequence is a combination of characters that has a meaning other than the
literal characters contained therein
In C++ escape sequence is composed of a backslash (\) and an escape sequence
character
Escape sequences are used in strings
For example to produce a beep sound
cout<<"\a";

ESCAPE SEQUENCE
Escape Sequence Description
\n Newline. Position the screen cursor to the
beginning of the next line.
\t Horizontal tab. Move the screen cursor to the next
tab stop.
\r Carriage return. Position the screen cursor to the
beginning of the current line; do not advance to
the next line.
\a Alert. Sound the system bell.
\\ Backslash. Used to print a backslash character.
\" Double quote. Used to print a double quote
character.

Thank you
Please subscribe my channel for more videos
and courses