By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,134 Members | 1,742 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,134 IT Pros & Developers. It's quick & easy.

calling a function via a pointer-to-function

P: n/a
WHO can tell me how can i the structural things about calling a function
via a pointer-to-function?
thank you.
Jul 23 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
NoWonder wrote:
WHO can tell me how can i the structural things about calling a function
via a pointer-to-function?
thank you.


Just like any other function:

void foo( void (*f)() )
{
f();
}

--
Matthias Kaeppler
Jul 23 '05 #2

P: n/a
Matthias Kaeppler wrote:
Just like any other function:

void foo( void (*f)() )
{
f();
}


Or even more human readable:

void foo( void f() )
{
f();
}

I think this is the same, but more intuitive to read. Does someone know
if this is a historical thing? Maybe the latter is only allowed in C++,
while the former is allowed in C as well as C++?

--
Matthias Kaeppler
Jul 23 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.