Repeat a string: Difference between revisions

m
no edit summary
(Add example for Zig)
mNo edit summary
Line 2,206:
At compile-time:
<lang zig>const laugh = "ha" ** 5;</lang>
Note that to achieve this at run-time in zig, (in order to avoid hidden overflows,) thereyou isn'tmust amanage specific way to accomplish this at run-time (the codememory above operates at compile-time)yourself.
<lang zig>const std = @import("std");
const warn = std.debug.warn;