escape sequence
Escape Character
If you are studying a language when you are a beginner, you may suffer from backslash. Therefore, backslash is a character that can be used in combination. Also, depending on the escape character, the function is different.
Escape Character | Explanation |
---|---|
\n | line break |
\t | tab |
\v | vertical tab |
\b | backspace |
\f | form feed (line break, move the cursor to the next line) |
\r | carriage return (line break, move the cursor forward) |
\a | ringtone (warning) |
\' | single quote |
\" | double quotes |
\ \ | \ |
\000 | ASCII characters in octal notation (null character) |
\ ? | literal question mark |
\ hh | ASCII characters in hexadecimal notation |
\ hhhh | A Unicode character in hexadecimal notation when this escape sequence is used in a wide-character constant or Unicode string literal. |
*** |
Not many, but I'll show you a few examples.
print("Hello World!")
Hello World!
print("Hello\nWorld!") # \n line break
Hello
World!
print("Hello\tWorld!") # \t tab
Hello World!
print("H\bello World!") # \b backspace
ello World!
print("\000") # \000 null character
print("\\Hello World!\\") # \\ '\'
\Hello World!\
reference site : https://docs.microsoft.com/ko-kr/cpp/c-language/escape-sequences?view=msvc-160
If there are any errors or problems in my writing, please let me know and I will correct or delete it.
반응형
'computer > Computer common sense' 카테고리의 다른 글
VS code 신기한 기능 (Screen cast mode) (0) | 2021.08.20 |
---|---|
네이버 웨일 백준 익스텐션 (확장 앱) (0) | 2021.08.14 |
윈도우 Vim 사용하기 (0) | 2021.07.29 |
D드라이브 포맷 방법 (0) | 2021.07.29 |
크롬 시작 페이지 설정 방법 (0) | 2021.07.21 |