I want the meaning of this statement

Discussion in 'C++' started by sam, Nov 10, 2006.

  1. sam

    sam Guest

    Hi, can anybody tell me the meaning of this:-
    void printfunc( void(*) (int&,int&) int&,int&) ;
    sam, Nov 10, 2006
    #1
    1. Advertising

  2. sam

    Pete Becker Guest

    sam wrote:
    > Hi, can anybody tell me the meaning of this:-
    > void printfunc( void(*) (int&,int&) int&,int&) ;
    >


    Looks like there's a comma missing.

    void printfunc( void(*fp)(int&,int&), int&, int&);

    The function printfunc takes three arguments and returns void. The first
    argument (which I've named fp) is a pointer to a function that takes two
    arguments of type int& and returns void. The second and third arguments
    are of type int&.

    --

    -- Pete
    Roundhouse Consulting, Ltd. -- www.versatilecoding.com
    Author of "The Standard C++ Library Extensions: a Tutorial and
    Reference." For more information about this book, see
    www.petebecker.com/tr1book.
    Pete Becker, Nov 10, 2006
    #2
    1. Advertising

  3. sam wrote:
    > Hi, can anybody tell me the meaning of this:-
    > void printfunc( void(*) (int&,int&) int&,int&) ;


    It's a declaration of a function 'printfunc'. There is an apparent
    missing comma in this statement, as well.

    V
    --
    Please remove capital 'A's when replying by e-mail
    I do not respond to top-posted replies, please don't ask
    Victor Bazarov, Nov 10, 2006
    #3
    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. peng
    Replies:
    3
    Views:
    447
  2. Replies:
    4
    Views:
    759
  3. Matt
    Replies:
    6
    Views:
    133
    Thomas 'PointedEars' Lahn
    Jul 30, 2004
  4. Replies:
    4
    Views:
    152
    Ted Zlatanov
    Sep 13, 2006
  5. pavi
    Replies:
    0
    Views:
    1,332
Loading...

Share This Page