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

Please explain it

P: n/a
HP
Hi All
i was reading the source code of one file, and i find this
declartion, can any one explain this for me please.

int (*func(const char data))(int, float,char);

Nov 11 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
HP wrote:
Hi All
i was reading the source code of one file, and i find this
declartion, can any one explain this for me please.

int (*func(const char data))(int, float,char);


This declares func to be a function which takes a const char (named
data) and which returns-- take a breath-- a pointer to a function which
takes (int, float, char) and returns an int.

So after defining func, this could be used as:

int i = func('a')(3,2.5,'b');

-Mark
Nov 11 '05 #2

P: n/a
HP
Thankx Mark

Nov 11 '05 #3

P: n/a
HP wrote:
Thankx Mark


You're welcome. Also, I didn't have this link handy at home last night
when I replied to your question, but you may want to look at:

http://www.ericgiguere.com/articles/...larations.html
Nov 11 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.