3 ms·
> There’s an argument that taking a substring off a C string a) can be done without allocating a copy b) can be done with pure pointer manipulation. In practice
by paavohtl 4y ago
> There’s an argument that taking a substring off a C string a) can be done without allocating a copy b) can be done with pure pointer manipulation. In practice though I’m not sure how critical that case is.
Rust supports the same features by storing the length of the string with the pointer. Same thing with other references to dynamically sized memory (slices).