4 ms·
I sometimes use data, but normally that's for a specific purpose - when I have a function that takes a void* in order to fit to a generic function template, whi
by NickPollard 14y ago
I sometimes use data, but normally that's for a specific purpose - when I have a function that takes a void* in order to fit to a generic function template, which I then cast to something in every function of that type.
e.g.
typedef void (*function_t)( void* );
void someFunction( void* data ) {
myStruct_s* myStruct = data;
// do something with myStruct
}
- cpeterso 14y agoI would write something like: void someFunction( void* pvMyStruct ) { myStruct_s* myStruct = pvMyStruct;