3 ms·
Well one reason I think is the following pattern in some library. struct SomeStruct { ... void (*callback)(A); A user_data; } Here A will be e
by im3w1l 5y ago
Well one reason I think is the following pattern in some library.
struct SomeStruct {
...
void (*callback)(A);
A user_data;
}
Here A will be either int or void*. But regardless of stated type, the expectation is that the user puts whatever they find the most convenient there, whether thats a pointer or integer (fd maybe?).