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

functions' pointer

P: n/a
gio
Can I have a definition of a pointer to a generic function ?

whitout specifing the type and number of the arguments?

Something like this can work?

void * (*fptr) (...);

I have read somewhere that I must specify at least the first argument
type. Is it true?

Thanks

Mar 17 '07 #1
Share this Question
Share on Google+
1 Reply


P: n/a
gio wrote, On 17/03/07 18:18:
Can I have a definition of a pointer to a generic function ?
No.
whitout specifing the type and number of the arguments?

Something like this can work?

void * (*fptr) (...);
Well, if you know the return type and it is only the parameter lists
which are different, and if not of them are varidac functions and if the
default argument promotions will give the correct types, you can use:
returntype (*fptr)();
However, if you do not pass the number and type (after promotion) of
arguments the actual function you are calling is defined as taking then
the behaviour is undefined, so anything can happen, with the most likely
result being hard to find bugs.
I have read somewhere that I must specify at least the first argument
type. Is it true?
That is true for varidac functions (ones using ...).

What is your real problem rather than what you think the solution might be?
--
Flash Gordon
Mar 17 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.