Apparently Zig used to provide this feature in an easy way, but it was removed in 6a5e61.
What is the recommended approach now for when such a behavior is needed? To manually iterate through the array/slice and set all bytes to zero?
Apparently Zig used to provide this feature in an easy way, but it was removed in 6a5e61.
What is the recommended approach now for when such a behavior is needed? To manually iterate through the array/slice and set all bytes to zero?
Use
std.mem.zeroes. Or use@memset.For example:
This prints: