diff options
| author | Chris Boesch <[email protected]> | 2023-02-16 19:28:10 +0100 |
|---|---|---|
| committer | Chris Boesch <[email protected]> | 2023-02-16 19:28:10 +0100 |
| commit | dc187889c1a0cec8cb0e7de67df96ebc9e981995 (patch) | |
| tree | a7e1052ecd65b52f3c3ba3a902cbe8b897a65856 | |
| parent | bb956254774ed022f29c70e98f7ca95c28f2c86f (diff) | |
| download | ziglings-dc187889c1a0cec8cb0e7de67df96ebc9e981995.tar.xz ziglings-dc187889c1a0cec8cb0e7de67df96ebc9e981995.zip | |
some improvements in the description
| -rw-r--r-- | build.zig | 8 | ||||
| -rw-r--r-- | exercises/093_hello_c.zig | 8 |
2 files changed, 8 insertions, 8 deletions
@@ -466,13 +466,13 @@ const exercises = [_]Exercise{ // .@"async" = true, // }, .{ + .main_file = "092_interfaces.zig", + .output = "Daily Insect Report:\nAnt is alive.\nBee visited 17 flowers.\nGrasshopper hopped 32 meters.", + }, + .{ .main_file = "093_hello_c.zig", .output = "Hello C from Zig! - C result ist 17 chars", .C = true, -}, -.{ - .main_file = "092_interfaces.zig", - .output = "Daily Insect Report:\nAnt is alive.\nBee visited 17 flowers.\nGrasshopper hopped 32 meters.", }, .{ .main_file = "999_the_end.zig", diff --git a/exercises/093_hello_c.zig b/exercises/093_hello_c.zig index 1877e04..b294f38 100644 --- a/exercises/093_hello_c.zig +++ b/exercises/093_hello_c.zig @@ -36,11 +36,11 @@ // // So that all this does not remain a dry theroy now, let's just start // and call a C function out of Zig. -// + // our well-known "import" for Zig const std = @import("std"); -// new the import for C +// and here the new the import for C const c = @cImport({ @cInclude("unistd.h"); }); @@ -50,9 +50,9 @@ pub fn main() void { // In order to output a text that can be evaluated by the // Zig Builder, we need to write it to the Error output. // In Zig we do this with "std.debug.print" and in C we can - // specify the file descriptor i.e. 2 for error console. + // specify a file descriptor i.e. 2 for error console. // - // In this case we use 'write' to output 17 chars, + // In this exercise we use 'write' to output 17 chars, // but something is missing... const c_res = write(2, "Hello C from Zig!", 17); |
