3 ms·
AFAICT you’d either have to pass the length at runtime somehow, or treat the function as a generic/template and generate a separate version for each separate N
by School-Cotton 3y ago
AFAICT you’d either have to pass the length at runtime somehow, or treat the function as a generic/template and generate a separate version for each separate N it’s called with. The latter would be pretty far from the ethos of C, imo.
- chongli 3y agoThis could be done by storing the length of the array before the first element. It wouldn’t even need to be done in all cases, only if the length is actually used.
- usefulcat 3y ago> AFAICT you’d either have to pass the length at runtime somehow This is exactly the solution proposed in TFA..