Re:Tell HN: C Experts Panel – Ask us anything about C
by zoomablemind on Thursday April 16, 2020 @05:33PM
(#22893804)
> ...You can remove the first k elements of a view with data += k.
How would you safely free(data) afterwards? You'd need to keep an alloc'ed pointer somehow.
Re:Tell HN: C Experts Panel – Ask us anything about C
by gkfasdfasdf on Thursday April 16, 2020 @09:09AM
(#22888954)
Got it. That is really neat, going to add to my bag of tricks...
With the length you would need to do data += k; length -= k
Especially if you want to use it as safe iterator, you can do data++ in a loop