Jul 12, 2010 at 9:21am Jul 12, 2010 at 9:21am UTC
Hi,
Lets say I have this prototype for a generic function call:
void (*func)(void* element)
Can I build a function (that I can call with the above call) with this header:
void something( int* num)
{
\\does something with the num
}
Just mind the header of the function (something function). Does that count as a "wrong prototype"? Can I do it?
Thanks!
Jul 12, 2010 at 10:49am Jul 12, 2010 at 10:49am UTC
No, you can't. You'd have to have a different function pointer.
Jul 12, 2010 at 11:12am Jul 12, 2010 at 11:12am UTC
What do you mean?
I do have a different function pointer in my MAIN. However, I just wanted to know is this ok to write the header that way ("something( int* num)" ) instead of ("something( void* num)" ) .
Thanks.