Remix.run Logo
▲ brabel a day ago

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!

▲jandrese a day ago | parent [-]

Sure you can do that, but you end up having to re-implement all of the standard library functions that expect to work with zero terminated arrays.