3 ms·
It's an extremely common pattern in C to have a struct with a bunch of associated functions which behave exactly like methods, taking a pointer to the struct as
by TillE 4y ago
It's an extremely common pattern in C to have a struct with a bunch of associated functions which behave exactly like methods, taking a pointer to the struct as their first argument.
- eyelidlessness 4y agoYup. This is exactly how Python methods work too. And how most functional code looks in any language.