cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
Beginners
A pointer function question.. advice is
A pointer function question.. advice is needed.
Jul 12, 2010 at 9:21am UTC
retro21
(4)
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 UTC
firedraco
(6243)
No, you can't. You'd have to have a different function pointer.
Jul 12, 2010 at 11:12am UTC
retro21
(4)
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.
Topic archived. No new replies allowed.