Re:Modern C++ for C Programmers (2018)
by nyberg on Saturday July 24, 2021 @05:40AM
(#27939500)
Rather, the underlying OS requires an array of bytes terminated by 0 which can be hidden behind a decent API. The type being poor at expressing this is not a limitation of the OS but of the C type system. E.g in zig this would be `[*:0]u8` which is "a pointer to a region of memory of unknown length terminated by a 0 sentinel value". It's still a pointer but nothing says the type system can't track more state around it.
[ Parent
| on HN ]
There are no comments on this comment yet.