Aout this function

Discussion in 'C Programming' started by Tyler, Jul 7, 2003.

  1. Tyler

    Tyler Guest

    I have seen one function implementationin C library like this:
    void(*
    signal(int sig, void(*func)(int)))(int)
    {
    /*implementation*/
    }

    I don't konw the meaning of this style of function implementation?
    Tyler, Jul 7, 2003
    #1
    1. Advertising

  2. On 7 Jul 2003 01:16:36 -0700, (Tyler) wrote:

    >I have seen one function implementationin C library like this:
    > void(*
    > signal(int sig, void(*func)(int)))(int)
    >{
    > /*implementation*/
    >}
    >
    >I don't konw the meaning of this style of function implementation?


    http://www.cs.umu.se/~isak/Snippets/rtlftrul.txt

    Usually an application of the right left rule is worthwhile. The
    above is a reference to it.

    In this case, signal is a function whose first parameter is of type
    int and whose second parameter is of type pointer to function that
    takes an int and returns void. signal returns a pointer to function
    that takes an int and returns a void.

    Best wishes,

    Bob
    Robert W Hand, Jul 7, 2003
    #2
    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. James Vanns
    Replies:
    7
    Views:
    7,035
    Evan Carew
    Jan 21, 2004
  2. komal
    Replies:
    6
    Views:
    1,421
    msalters
    Jan 25, 2005
  3. Replies:
    2
    Views:
    922
    Bengt Richter
    Aug 1, 2005
  4. Giannis Papadopoulos

    Function pointer to void function and int function

    Giannis Papadopoulos, Sep 5, 2005, in forum: C Programming
    Replies:
    5
    Views:
    1,236
    Barry Schwarz
    Sep 5, 2005
  5. weafon
    Replies:
    1
    Views:
    305
    Diez B. Roggisch
    Jul 14, 2009
Loading...

Share This Page