Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > Please explain it

Reply
Thread Tools

Please explain it

 
 
HP
Guest
Posts: n/a
 
      11-11-2005
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);

 
Reply With Quote
 
 
 
 
Mark P
Guest
Posts: n/a
 
      11-11-2005
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
 
Reply With Quote
 
 
 
 
HP
Guest
Posts: n/a
 
      11-11-2005
Thankx Mark

 
Reply With Quote
 
Mark P
Guest
Posts: n/a
 
      11-11-2005
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
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Please explain this "Why's" example please Kaye Ng Ruby 8 06-08-2010 09:13 AM
70-292: can someone please verify / explain the answer to this question Tim Moor MCSE 7 12-18-2005 03:30 AM
Explain this a little better please. fwells11@hotmail.com Cisco 3 07-31-2005 06:49 AM
Someone please explain to me ... =?Utf-8?B?bXJzLmdyYW50?= Wireless Networking 6 11-25-2004 10:08 PM
please help... ...me learn C++ please please please :) KK C++ 2 10-14-2003 02:08 PM



Advertisments