zig/doc/langref/print_comptime-known_format.zig

12 lines
239 B
Zig

const print = @import("std").debug.print;
const a_number: i32 = 1234;
const a_string = "foobar";
const fmt = "here is a string: '{s}' here is a number: {}\n";
pub fn main() void {
print(fmt, .{a_string, a_number});
}
// exe=succeed