-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathescape_sequences.cpp
More file actions
26 lines (25 loc) · 1.08 KB
/
Copy pathescape_sequences.cpp
File metadata and controls
26 lines (25 loc) · 1.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#include<iostream>
using namespace std;
int main()
{
cout<<"hello \nworld"<<endl;
cout<<"hello \rworld"<<endl;
cout<<"hello \tworld"<<endl;
cout<<"hello \bworld"<<endl;
cout<<"hello \vworld"<<endl;
cout<<"hello \fworld"<<endl;
//escape sequences are special charaters used in control string to modify the format of output.
/*
| Escape Sequence | Meaning | Example Output |
| --------------- | --------------- | ----------------------------- |
| \n | New line | Moves text to next line |
| \r | Carriage return | Moves cursor to start of line |
| \t | Horizontal tab | Adds space like a tab |
| \b | Backspace | Deletes previous character |
| \f | Form feed | Page break (rarely used) |
| \v | Vertical tab | Vertical spacing |
| \' | Single quote | Prints `'` |
| \" | Double quote | Prints `"` |
| \\ | Backslash | Prints `\` |
*/
}