Please explain it

H

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);
 
M

Mark P

HP said:
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Staff online

Members online

Forum statistics

Threads
473,764
Messages
2,569,564
Members
45,040
Latest member
papereejit

Latest Threads

Top