summaryrefslogtreecommitdiff
path: root/zig-embed/main.zig
diff options
context:
space:
mode:
Diffstat (limited to 'zig-embed/main.zig')
-rw-r--r--zig-embed/main.zig14
1 files changed, 14 insertions, 0 deletions
diff --git a/zig-embed/main.zig b/zig-embed/main.zig
new file mode 100644
index 0000000..a1089b9
--- /dev/null
+++ b/zig-embed/main.zig
@@ -0,0 +1,14 @@
+const std = @import("std");
+
+pub fn main() !void {
+ const data: []const u8 = @embedFile("max.txt");
+
+ // Print the whole file out.
+ std.debug.print("{s}\n", .{data});
+
+ // Loop over each byte.
+ for (data) |c| {
+ std.debug.print("0x{X:0>2} ", .{c});
+ }
+ std.debug.print("\n", .{});
+}