When are function pointers used?
And how would I go about making an array of function pointers, each pointing to a different function with different return types and different parameters?
When are function pointers used?
And how would I go about making an array of function pointers, each pointing to a different function with different return types and different parameters?
I AM WINNER!!!1!111oneoneomne
Manually doing dynamic binding with a vtable (and other places, but this is probably the most common).Originally posted by Panopticon
When are function pointers used?
You can't make an array of function pointers with different return types or arguments. You can make an array of function pointers with the same argument types and return types though:Originally posted by Panopticon
And how would I go about making an array of function pointers, each pointing to a different function with different return types and different parameters?
Returntype (*ArrayName[NumberOrElements])(Arguments);