You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
My initial thought is that you provide a read-only source, a start index, an end index, and a writable destination. The indexes will be [start, end) as per most uses of indexes. The user can use -1 for "to the end". Here's the signature:
I have struct cgs_strsub for "slices" of a string, perhaps the equivalent for vectors should be a struct vecsub? A non-owning view into a vector. Maybe.
As for my initial need, that being AoC 2022 day 5, it seems a splice function is more appropriate. This would allow me to remove and replace multiple elements if I wanted.
My initial thought is that you provide a read-only source, a start index, an end index, and a writable destination. The indexes will be [start, end) as per most uses of indexes. The user can use -1 for "to the end". Here's the signature:
This will return 'dst' on success and NULL on any kind of failure. And a typical use:
Usability concerns:
The text was updated successfully, but these errors were encountered: