 The Zig Programming Language 0.2.0 DocumentationZig. This HTML document depends on no external files, so you can use it offline. Hello World hello.zig const std = @import("std"); pub fn main() !void { // If this program is run without stdout stdout, e // with an error. try stdout_file.write("Hello, world!\n"); } $ zig build-exe hello.zig $ ./hello Hello, world! Usually you don't want to write to stdout. You want to write to stderr For that you can use a simpler API: hello.zig const warn = @import("std").debug.warn; pub fn main() void { warn("Hello, world!\n"); } $ zig build-exe hello.zig $ ./hello Hello, world! Note that0 码力 | 117 页 | 2.84 MB | 1 年前3 The Zig Programming Language 0.2.0 DocumentationZig. This HTML document depends on no external files, so you can use it offline. Hello World hello.zig const std = @import("std"); pub fn main() !void { // If this program is run without stdout stdout, e // with an error. try stdout_file.write("Hello, world!\n"); } $ zig build-exe hello.zig $ ./hello Hello, world! Usually you don't want to write to stdout. You want to write to stderr For that you can use a simpler API: hello.zig const warn = @import("std").debug.warn; pub fn main() void { warn("Hello, world!\n"); } $ zig build-exe hello.zig $ ./hello Hello, world! Note that0 码力 | 117 页 | 2.84 MB | 1 年前3
 The Zig Programming Language 0.7.1 DocumentationWorld hello.zig const std = @import("std"); pub fn main() !void { const stdout = std.io.getStdOut().writer(); try stdout.print("Hello, {}!\n", .{"world"}); } $ zig build-exe hello.zig $ ./hello usually named with the .zig extension. Following the hello.zig Zig code sample, the Zig Build System is used to build an executable program from the hello.zig source code. Then, the hello program is executed function cannot perform its task, it might return an error. Zig makes all of this explicit. In the hello.zig code sample, the main function is declared with the !void return type. This return type is known0 码力 | 225 页 | 5.74 MB | 1 年前3 The Zig Programming Language 0.7.1 DocumentationWorld hello.zig const std = @import("std"); pub fn main() !void { const stdout = std.io.getStdOut().writer(); try stdout.print("Hello, {}!\n", .{"world"}); } $ zig build-exe hello.zig $ ./hello usually named with the .zig extension. Following the hello.zig Zig code sample, the Zig Build System is used to build an executable program from the hello.zig source code. Then, the hello program is executed function cannot perform its task, it might return an error. Zig makes all of this explicit. In the hello.zig code sample, the main function is declared with the !void return type. This return type is known0 码力 | 225 页 | 5.74 MB | 1 年前3
 The Zig Programming Language 0.9.1 Documentationdocumentation. To learn more about the Zig Standard Library, visit the link above. Hello World hello.zig 1 const std = @import("std"); 2 3 pub fn main() !void { 4 const stdout = std.io.getStdOut() writer(); 5 try stdout.print("Hello, {s}!\n", .{"world"}); 6 } Shell 1 $ zig build-exe hello.zig 2 3 $ ./hello 4 Hello, world! The Zig code sample above demonstrates one way to create a program a file named hello.zig . Files storing Zig source code are UTF-8 encoded text files. The files storing Zig source code are usually named with the .zig extension. Following the hello.zig Zig code sample0 码力 | 234 页 | 7.90 MB | 1 年前3 The Zig Programming Language 0.9.1 Documentationdocumentation. To learn more about the Zig Standard Library, visit the link above. Hello World hello.zig 1 const std = @import("std"); 2 3 pub fn main() !void { 4 const stdout = std.io.getStdOut() writer(); 5 try stdout.print("Hello, {s}!\n", .{"world"}); 6 } Shell 1 $ zig build-exe hello.zig 2 3 $ ./hello 4 Hello, world! The Zig code sample above demonstrates one way to create a program a file named hello.zig . Files storing Zig source code are UTF-8 encoded text files. The files storing Zig source code are usually named with the .zig extension. Following the hello.zig Zig code sample0 码力 | 234 页 | 7.90 MB | 1 年前3
 The Zig Programming Language 0.8.1 DocumentationWorld hello.zig const std = @import("std"); pub fn main() !void { const stdout = std.io.getStdOut().writer(); try stdout.print("Hello, {s}!\n", .{"world"}); } $ zig build-exe hello.zig $ ./hello usually named with the .zig extension. Following the hello.zig Zig code sample, the Zig Build System is used to build an executable program from the hello.zig source code. Then, the hello program is executed function cannot perform its task, it might return an error. Zig makes all of this explicit. In the hello.zig code sample, the main function is declared with the !void return type. This return type is known0 码力 | 234 页 | 6.01 MB | 1 年前3 The Zig Programming Language 0.8.1 DocumentationWorld hello.zig const std = @import("std"); pub fn main() !void { const stdout = std.io.getStdOut().writer(); try stdout.print("Hello, {s}!\n", .{"world"}); } $ zig build-exe hello.zig $ ./hello usually named with the .zig extension. Following the hello.zig Zig code sample, the Zig Build System is used to build an executable program from the hello.zig source code. Then, the hello program is executed function cannot perform its task, it might return an error. Zig makes all of this explicit. In the hello.zig code sample, the main function is declared with the !void return type. This return type is known0 码力 | 234 页 | 6.01 MB | 1 年前3
 The Zig Programming Language 0.3.0 DocumentationZig. This HTML document depends on no external files, so you can use it offline. Hello World hello.zig const std = @import("std"); pub fn main() !void { // If this program is run without stdout stdout, e // with an error. try stdout_file.write("Hello, world!\n"); } $ zig build-exe hello.zig $ ./hello Hello, world! Usually you don't want to write to stdout. You want to write to stderr For that you can use a simpler API: hello.zig const warn = @import("std").debug.warn; pub fn main() void { warn("Hello, world!\n"); } $ zig build-exe hello.zig $ ./hello Hello, world! Note that0 码力 | 175 页 | 4.08 MB | 1 年前3 The Zig Programming Language 0.3.0 DocumentationZig. This HTML document depends on no external files, so you can use it offline. Hello World hello.zig const std = @import("std"); pub fn main() !void { // If this program is run without stdout stdout, e // with an error. try stdout_file.write("Hello, world!\n"); } $ zig build-exe hello.zig $ ./hello Hello, world! Usually you don't want to write to stdout. You want to write to stderr For that you can use a simpler API: hello.zig const warn = @import("std").debug.warn; pub fn main() void { warn("Hello, world!\n"); } $ zig build-exe hello.zig $ ./hello Hello, world! Note that0 码力 | 175 页 | 4.08 MB | 1 年前3
 The Zig Programming Language 0.11.0 Documentationdocumentation. To learn more about the Zig Standard Library, visit the link above. 3. Hello World hello.zig 1 const std = @import("std"); 2 3 pub fn main() !void { 4 const stdout = std.io.getStdOut() getStdOut().writer(); 5 try stdout.print("Hello, {s}!\n", .{"world"}); 6 } Shell $ zig build-exe hello.zig $ ./hello Hello, world! The Zig code sample above demonstrates one way to create a program that of a file named hello.zig . Files storing Zig source code are UTF-8 encoded text files. The files storing Zig source code must be named with the .zig extension. Following the hello.zig Zig code sample0 码力 | 238 页 | 7.80 MB | 1 年前3 The Zig Programming Language 0.11.0 Documentationdocumentation. To learn more about the Zig Standard Library, visit the link above. 3. Hello World hello.zig 1 const std = @import("std"); 2 3 pub fn main() !void { 4 const stdout = std.io.getStdOut() getStdOut().writer(); 5 try stdout.print("Hello, {s}!\n", .{"world"}); 6 } Shell $ zig build-exe hello.zig $ ./hello Hello, world! The Zig code sample above demonstrates one way to create a program that of a file named hello.zig . Files storing Zig source code are UTF-8 encoded text files. The files storing Zig source code must be named with the .zig extension. Following the hello.zig Zig code sample0 码力 | 238 页 | 7.80 MB | 1 年前3
 The Zig Programming Language 0.10.1 Documentationdocumentation. To learn more about the Zig Standard Library, visit the link above. Hello World hello.zig 1 const std = @import("std"); 2 3 pub fn main() !void { 4 const stdout = std.io.getStdOut() writer(); 5 try stdout.print("Hello, {s}!\n", .{"world"}); 6 } Shell 1 $ zig build-exe hello.zig 2 3 $ ./hello 4 Hello, world! The Zig code sample above demonstrates one way to create a program a file named hello.zig . Files storing Zig source code are UTF-8 encoded text files. The files storing Zig source code are usually named with the .zig extension. Following the hello.zig Zig code sample0 码力 | 239 页 | 8.03 MB | 1 年前3 The Zig Programming Language 0.10.1 Documentationdocumentation. To learn more about the Zig Standard Library, visit the link above. Hello World hello.zig 1 const std = @import("std"); 2 3 pub fn main() !void { 4 const stdout = std.io.getStdOut() writer(); 5 try stdout.print("Hello, {s}!\n", .{"world"}); 6 } Shell 1 $ zig build-exe hello.zig 2 3 $ ./hello 4 Hello, world! The Zig code sample above demonstrates one way to create a program a file named hello.zig . Files storing Zig source code are UTF-8 encoded text files. The files storing Zig source code are usually named with the .zig extension. Following the hello.zig Zig code sample0 码力 | 239 页 | 8.03 MB | 1 年前3
 The Zig Programming Language 0.4.0 DocumentationWhitespace Names Examples Source Encoding Keyword Reference Keyword: pub Grammar Zen Hello World hello.zig const std = @import("std"); pub fn main() !void { // If this program is run without stdout stdout, e // with an error. try stdout_file.write("Hello, world!\n"); } $ zig build-exe hello.zig $ ./hello Hello, world! Usually you don't want to write to stdout. You want to write to stderr For that you can use a simpler API: hello.zig const warn = @import("std").debug.warn; pub fn main() void { warn("Hello, world!\n"); } $ zig build-exe hello.zig $ ./hello Hello, world! Note that0 码力 | 207 页 | 5.29 MB | 1 年前3 The Zig Programming Language 0.4.0 DocumentationWhitespace Names Examples Source Encoding Keyword Reference Keyword: pub Grammar Zen Hello World hello.zig const std = @import("std"); pub fn main() !void { // If this program is run without stdout stdout, e // with an error. try stdout_file.write("Hello, world!\n"); } $ zig build-exe hello.zig $ ./hello Hello, world! Usually you don't want to write to stdout. You want to write to stderr For that you can use a simpler API: hello.zig const warn = @import("std").debug.warn; pub fn main() void { warn("Hello, world!\n"); } $ zig build-exe hello.zig $ ./hello Hello, world! Note that0 码力 | 207 页 | 5.29 MB | 1 年前3
 The Zig Programming Language 0.6.0 DocumentationWorld hello.zig const std = @import("std"); pub fn main() !void { const stdout = std.io.getStdOut().outStream(); try stdout.print("Hello, {}!\n", .{"world"}); } $ zig build-exe hello.zig $ ./hello that you can use a simpler API: hello.zig const warn = @import("std").debug.warn; pub fn main() void { warn("Hello, world!\n", .{}); } $ zig build-exe hello.zig $ ./hello Hello, world! Note that0 码力 | 214 页 | 5.37 MB | 1 年前3 The Zig Programming Language 0.6.0 DocumentationWorld hello.zig const std = @import("std"); pub fn main() !void { const stdout = std.io.getStdOut().outStream(); try stdout.print("Hello, {}!\n", .{"world"}); } $ zig build-exe hello.zig $ ./hello that you can use a simpler API: hello.zig const warn = @import("std").debug.warn; pub fn main() void { warn("Hello, world!\n", .{}); } $ zig build-exe hello.zig $ ./hello Hello, world! Note that0 码力 | 214 页 | 5.37 MB | 1 年前3
 The Zig Programming Language 0.5.0 DocumentationWhitespace Names Examples Source Encoding Keyword Reference Keyword: pub Grammar Zen Hello World hello.zig const std = @import("std"); pub fn main() !void { // If this program is run without stdout stdout, e // with an error. try stdout_file.write("Hello, world!\n"); } $ zig build-exe hello.zig $ ./hello Hello, world! Usually you don't want to write to stdout. You want to write to stderr For that you can use a simpler API: hello.zig const warn = @import("std").debug.warn; pub fn main() void { warn("Hello, world!\n"); } $ zig build-exe hello.zig $ ./hello Hello, world! Note that0 码力 | 224 页 | 5.80 MB | 1 年前3 The Zig Programming Language 0.5.0 DocumentationWhitespace Names Examples Source Encoding Keyword Reference Keyword: pub Grammar Zen Hello World hello.zig const std = @import("std"); pub fn main() !void { // If this program is run without stdout stdout, e // with an error. try stdout_file.write("Hello, world!\n"); } $ zig build-exe hello.zig $ ./hello Hello, world! Usually you don't want to write to stdout. You want to write to stderr For that you can use a simpler API: hello.zig const warn = @import("std").debug.warn; pub fn main() void { warn("Hello, world!\n"); } $ zig build-exe hello.zig $ ./hello Hello, world! Note that0 码力 | 224 页 | 5.80 MB | 1 年前3
共 12 条
- 1
- 2













