Skip to content

Commit b04d29b

Browse files
committed
typo
1 parent a1906d7 commit b04d29b

File tree

5 files changed

+16
-16
lines changed

5 files changed

+16
-16
lines changed

add_your_program/index.rst

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -38,16 +38,16 @@
3838
:linenos:
3939
4040
add_program(example_single
41-
src/example_single/index.cpp
41+
src/example_single/main.cpp
4242
)
4343
44-
这段代码添加了一个名为 ``example_single`` 的程序, 它由 src/example_single/index.cpp 源代码——src 文件夹里的 example_single 文件夹里的 main.cpp 源文件——组成.
44+
这段代码添加了一个名为 ``example_single`` 的程序, 它由 src/example_single/main.cpp 源代码——src 文件夹里的 example_single 文件夹里的 main.cpp 源文件——组成.
4545

46-
src/example_single/index.cpp 中有一个 :cpp:`int main()` 函数, 它就是该程序执行的入口:
46+
src/example_single/main.cpp 中有一个 :cpp:`int main()` 函数, 它就是该程序执行的入口:
4747

4848
.. code-block:: cpp
4949
:linenos:
50-
:caption: src/example_single/index.cpp
50+
:caption: src/example_single/main.cpp
5151
5252
#include "add.hpp"
5353
@@ -107,16 +107,16 @@ src/example_single/index.cpp 中有一个 :cpp:`int main()` 函数, 它就是该
107107
:linenos:
108108
109109
add_program(example_multiple
110-
src/example_multiple/index.cpp
110+
src/example_multiple/main.cpp
111111
src/example_multiple/hello.cpp
112112
)
113113
114-
这段代码添加了一个名为 ``example_multiple`` 的程序, 它由 src/example_multiple/index.cpp 和 src/example_multiple/hello.cpp 中.
114+
这段代码添加了一个名为 ``example_multiple`` 的程序, 它由 src/example_multiple/main.cpp 和 src/example_multiple/hello.cpp 中.
115115

116116

117117
.. code-block:: cpp
118118
:linenos:
119-
:caption: src/example_multiple/index.cpp
119+
:caption: src/example_multiple/main.cpp
120120
121121
#include "hello.hpp"
122122
@@ -126,7 +126,7 @@ src/example_single/index.cpp 中有一个 :cpp:`int main()` 函数, 它就是该
126126
127127
由源代码可知, 该程序的执行无非是以 :cpp:`int main()` 函数为入口, 调用 :cpp:`hello()` 函数.
128128

129-
为什么 src/example_multiple/index.cpp 会知道有个 :cpp:`hello()` 函数呢? 因为 :cpp:`#include "hello.hpp"` 所包含的头文件中书写了该函数的声明, 但是可以注意到的是, **该头文件中并没有定义 hello() 函数要干什么**.
129+
为什么 src/example_multiple/main.cpp 会知道有个 :cpp:`hello()` 函数呢? 因为 :cpp:`#include "hello.hpp"` 所包含的头文件中书写了该函数的声明, 但是可以注意到的是, **该头文件中并没有定义 hello() 函数要干什么**.
130130

131131
.. code-block:: cpp
132132
:linenos:
@@ -161,7 +161,7 @@ src/example_single/index.cpp 中有一个 :cpp:`int main()` 函数, 它就是该
161161
:linenos:
162162
163163
add_program(example_multiple
164-
src/example_multiple/index.cpp # 定义程序入口函数 main, 它调用 hello 函数.
164+
src/example_multiple/main.cpp # 定义程序入口函数 main, 它调用 hello 函数.
165165
src/example_multiple/hello.cpp # 定义 hello 函数
166166
)
167167
@@ -184,11 +184,11 @@ src/example_single/index.cpp 中有一个 :cpp:`int main()` 函数, 它就是该
184184
:linenos:
185185
186186
add_program(example_multiple
187-
src/example_multiple/index.cpp # 定义程序入口函数 main, 它调用 hello 函数.
187+
src/example_multiple/main.cpp # 定义程序入口函数 main, 它调用 hello 函数.
188188
src/example_multiple/hello.cpp # 定义 hello 函数
189189
)
190190
add_program(example_multiple2
191-
src/example_multiple/index.cpp # 同样用 main.cpp
191+
src/example_multiple/main.cpp # 同样用 main.cpp
192192
src/example_multiple/hello2.cpp # 用另一种方式定义 hello 函数
193193
)
194194

third_party/conan/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ Ubuntu/Debian
134134
:linenos:
135135
136136
add_program(example_multiple # 程序名为 example_multiple
137-
src/example_multiple/index.cpp # 源文件 1
137+
src/example_multiple/main.cpp # 源文件 1
138138
src/example_multiple/hello.cpp # 源文件 2
139139
)
140140

third_party/vcpkg/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
:linenos:
6363
6464
add_program(example_multiple # 程序名为 example_multiple
65-
src/example_multiple/index.cpp # 源文件 1
65+
src/example_multiple/main.cpp # 源文件 1
6666
src/example_multiple/hello.cpp # 源文件 2
6767
)
6868

verify/debug/index.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@ VSCode 只是通用的编辑器, 并不知道你会如何进行调试或运行,
2929

3030
根据上面的描述, 要调试 test, 我们将 *当前预生成的目标* 和 *当前预运行的目标* 均设置为 :menuselection:`[test]`, 点击 :menuselection:`运行和调试 --> ▶播放按钮` 或按快捷键 :KBD:`F5` 即可.
3131

32-
当然, 在调试前, 我们需要在 test 程序对应的源文件 :cpp:`test/index.cpp` 中设置断点:
32+
当然, 在调试前, 我们需要在 test 程序对应的源文件 :cpp:`test/main.cpp` 中设置断点:
3333

34-
1. 点开 ``test/index.cpp``.
34+
1. 点开 ``test/main.cpp``.
3535
2. 选择要中断的行, 通过 :KBD:`左击` 行号左边空白区域设置断点, 例如设置在第 7 行 :cpp:`int x{};` 处.
3636

3737
.. figure:: 设置断点.png

verify/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
3.检验配置结果和实际使用
33
************************************************************************************************************************
44

5-
从左边侧边栏打开 test/index.cpp (test 文件夹下的 main.cpp 文件), 以下操作均在 test/index.cpp 中进行.
5+
从左边侧边栏打开 test/main.cpp (test 文件夹下的 main.cpp 文件), 以下操作均在 test/main.cpp 中进行.
66

77
.. figure:: 左边侧边栏.png
88

0 commit comments

Comments
 (0)