77 ms·
How do I write a C function which operates on array of type T? Which generic operations does the language provide?
by monkeyelite 1y ago
How do I write a C function which operates on array of type T?
Which generic operations does the language provide?
- gpderetta 1y agoArrays are generic, but of course C doen't provide generic functions. You can generically copy arrays [1], index them, iterate them, compute their size. But that's not the point, the point is that you can instantiate them for any (complete) T. [1] well, C is weird, so you first need to wrap them in a struct.