Patch 83 - string type?
flo80 opened this issue · 2 comments
The patch for exercise 83 (anonymous lists) uses the type [5]u8
for the string. To be consistent with exercise 77 (sentinels) shouldn't it be [5:0]u8
? (It makes not difference to the solution, it's purely for consistency)
@flo80 The task of Exercise 83 is different from Exercise 77. In Exercise 83 you are not supposed to make a slice with a sentinel. Just a string-like array. And yes, it makes no difference in the final result, only in our imagination. 😉
I'm gonna go ahead and close this for now. I feel like the the Zig string stuff is going to be confusing no matter how we "slice it" (pun intended). Both types really are valid in different situations. But @flo80 feel free to re-open (or make a PR!) if you think there's a way we can help explain this better. Thanks!