Please explain it

Discussion in 'C++' started by HP, Nov 11, 2005.

  1. HP

    HP Guest

    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);
    HP, Nov 11, 2005
    #1
    1. Advertising

  2. HP

    Mark P Guest

    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
    Mark P, Nov 11, 2005
    #2
    1. Advertising

  3. HP

    HP Guest

    Thankx Mark
    HP, Nov 11, 2005
    #3
  4. HP

    Mark P Guest

    Mark P, Nov 11, 2005
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. suzy
    Replies:
    3
    Views:
    439
  2. BluDog

    Can Someone Please Explain...

    BluDog, Oct 4, 2004, in forum: ASP .Net
    Replies:
    4
    Views:
    470
    BluDog
    Oct 5, 2004
  3. Alan Silver
    Replies:
    1
    Views:
    472
    Alan Silver
    Jun 28, 2005
  4. KK
    Replies:
    2
    Views:
    528
    Big Brian
    Oct 14, 2003
  5. Kaye Ng
    Replies:
    8
    Views:
    167
    Josh Cheek
    Jun 8, 2010
Loading...

Share This Page