Assuming a sentinel-terminated pointer, how can one print individual bytes of the region that it's pointing to?
Iteration seems not possible due to error: type '[*:0]const u8' does not support field access for (foobar) |character, i| {
i guess std.fmt.fmtSliceHexLower can help but results in expected type '[]const u8', found '[*:0]const u8' also you can't format individual bytes with that.
#Printing memory content
1 messages · Page 1 of 1 (latest)
there might be something in std, but iteration is totally possible
you just need to use a while loop
or you can just create a slice (which is what for and most std functions are expecting) if you know the size
which you can find with std.mem.len
using a slice works thx 🙂