logoalt Hacker News

raverbashing • today at 3:30 PM • 2 replies • view on HN

Yeah

The lack of a native slice is the most glaring C fault I think exists

(And of course the committees won't implement it, and of course C is going to remain broken)


Replies

uecker • today at 4:21 PM

You could help? https://www.open-std.org/jtc1/sc22/wg14/www/contributing.htm...

But I am also quite happy about how far one already gets with variably modified types and a custom span type: https://godbolt.org/z/rPen5Movd

brabel • today at 4:19 PM

I don’t get it, C arrays can be used as slices, no?? Given a pointer and a length, which is how C does any array, works just as well (I mean if you consider arrays without a length a fine thing) as a slice!