Skip to content

Commit d935c5b

Browse files
pwh-pwhjinzhongjia
authored andcommitted
fix: 修正 One.main 函数的返回类型为 !void 以及更新zig init命令
1 parent 4ae4f06 commit d935c5b

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

course/code/14/hello_world.zig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ const One = struct {
88
// #region one
99
const std = @import("std");
1010

11-
pub fn main() void {
11+
pub fn main() !void {
1212
std.debug.print("Hello, World!\n", .{});
1313
}
1414
// #endregion one

course/hello-world.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ outline: deep
66

77
与学习其他编程语言一样,我们也将从经典的 `Hello, World!` 程序开始,以此向 Zig 的世界打一声招呼。
88

9-
首先,使用 `zig init-exe` 命令初始化一个可执行项目,然后将以下内容覆盖写入到 `src/main.zig` 文件中。
9+
首先,使用 `zig init` 命令初始化一个可执行项目,然后将以下内容覆盖写入到 `src/main.zig` 文件中。
1010

1111
<!-- 引入代码片段 -->
1212
<!-- 具体说明见:https://vitepress.dev/zh/guide/markdown#import-code-snippets -->

0 commit comments

Comments
 (0)