Skip to content

Commit 89f3cec

Browse files
committed
Optimize Article
1 parent efb0899 commit 89f3cec

File tree

2 files changed

+258
-61
lines changed

2 files changed

+258
-61
lines changed

source/Language Core/Chapter-1/Section-03.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,4 +66,20 @@ Hello World!
6666

6767
```{tip}
6868
事实上在 C++ 98 标准也就是第一个正式标准发布的时候,程序的主函数 `int main()` 就已经可以不使用 `return` 语句了。当程序在主函数结束时未遇到返回语句则默认执行返回语句,它等价于 `return 0;`.
69+
```
70+
71+
## 转义序列
72+
73+
C++ 支持使用转义序列表示特殊字符
74+
75+
```CPP
76+
#include <iostream>
77+
78+
int main() {
79+
std::cout << "Hello\tWorld!\n"; // \t 制表符,\n 换行符
80+
std::cout << "Hello\\World!\n"; // \\ 反斜杠
81+
std::cout << "Hello\"World!\"\n"; // \" 双引号
82+
std::cout << "Hello\'World!\'\n"; // \' 单引号
83+
std::cout << "Hello\0World!\n"; // \0 空字符(字符串结束符)
84+
}
6985
```

0 commit comments

Comments
 (0)