3 ms·
Alternatively: const print = @import("std").debug.print; pub fn main() void { print("Hello {s}!", .{"World"}); } Or using the logging API
by flohofwoe 4y ago
Alternatively:
const print = @import("std").debug.print;
pub fn main() void {
print("Hello {s}!", .{"World"});
}
Or using the logging API:
const info = @import("std").log.info;
pub fn main() void {
info("Hello {s}!", .{"World"});
}
(I'm actually not sure why Zig doesn't have a simple way to print to stdout, but I guess there are 'reasons')
- Koshkin 4y agoZig is the ugliest of the Three Piglets (the other two being Rust and Swift).
- KRAKRISMOTT 4y agoAnd the Big Bad Go will come and blow down their houses.
- Koshkin 4y agoIndeed, Go Is Great.
- throwawaymaths 4y agoyou might not have a stdout, for example very low to the metal.