What does "void (*vector[])( )" means?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Bruce Sam

    What does "void (*vector[])( )" means?

    Is this a pointer array of function?If I was wrong,what does it
    means?

  • Ben Pfaff

    #2
    Re: What does "void (*vector[])( )" means?

    "Bruce Sam" <persevreman@ya hoo.com.cn> writes:
    [color=blue]
    > Is this a pointer array of function?If I was wrong,what does it
    > means?[/color]

    array of pointer to function returning void
    --
    "IMO, Perl is an excellent language to break your teeth on"
    --Micah Cowan

    Comment

    • angelo

      #3
      Re: What does &quot;void (*vector[])( )&quot; means?

      Bruce Sam wrote:[color=blue]
      > Is this a pointer array of function?If I was wrong,what does it
      > means?
      >[/color]

      void (*vector[])( )

      can be simplied (in terms of readability) as

      typedef void (*PF) ();
      PF vector[];

      Comment

      • Trent Buck

        #4
        Re: What does &quot;void (*vector[])( )&quot; means?

        Quoth Ben Pfaff on or about 2004-11-12:[color=blue][color=green]
        > > Is this a pointer array of function?If I was wrong,what does it
        > > means?[/color]
        >
        > array of pointer to function returning void[/color]

        If you also mention cdecl(1), the OP might answer the next question
        himself.

        From the manpage:

        Cdecl (and c++decl) is a program for encoding and decoding C (or
        C++) type declarations.

        -trent

        Comment

        • Martin Ambuhl

          #5
          Re: What does &quot;void (*vector[])( )&quot; means?

          Bruce Sam wrote:[color=blue]
          > Is this a pointer array of function?If I was wrong,what does it
          > means?
          >[/color]

          Don't forget to put important parts of your message in the message. It
          is not sufficient to hide that information in a header.
          "void (*vector[])( )" declares vector as an array of pointers to
          functions with an unspecified argument list and returning nothing.

          Comment

          • Stuart Gerchick

            #6
            Re: What does &quot;void (*vector[])( )&quot; means?

            "Bruce Sam" <persevreman@ya hoo.com.cn> wrote in message news:<110030986 8.398790.212180 @f14g2000cwb.go oglegroups.com> ...[color=blue]
            > Is this a pointer array of function?If I was wrong,what does it
            > means?[/color]

            This is an array of functions each with no (undefined) argument list
            that return void. It can be made easier to understand ysing a typdef
            for the function

            Comment

            • Robert Gamble

              #7
              Re: What does &quot;void (*vector[])( )&quot; means?

              On Sun, 14 Nov 2004 08:22:37 -0800, Stuart Gerchick wrote:
              [color=blue]
              > "Bruce Sam" <persevreman@ya hoo.com.cn> wrote in message
              > news:<110030986 8.398790.212180 @f14g2000cwb.go oglegroups.com> ...[color=green]
              >> Is this a pointer array of function?If I was wrong,what does it means?[/color]
              >
              > This is an array of functions each with no (undefined) argument list[/color]

              That should be "array of pointers to functions", you cannot have an "array
              of functions" in C.
              [color=blue]
              > that return void. It can be made easier to understand ysing a typdef
              > for the function[/color]

              Rob Gamble

              Comment

              • Barry Schwarz

                #8
                Re: What does &quot;void (*vector[])( )&quot; means?

                On 14 Nov 2004 08:22:37 -0800, sgerchick@bloom berg.net (Stuart
                Gerchick) wrote:
                [color=blue]
                >"Bruce Sam" <persevreman@ya hoo.com.cn> wrote in message news:<110030986 8.398790.212180 @f14g2000cwb.go oglegroups.com> ...[color=green]
                >> Is this a pointer array of function?If I was wrong,what does it
                >> means?[/color]
                >
                >This is an array of functions each with no (undefined) argument list
                >that return void. It can be made easier to understand ysing a typdef
                >for the function[/color]

                Almost. It is an array of *pointer to* function. The parameter list
                of the function is *unspecified*, which does not necessarily mean the
                function takes no arguments.


                <<Remove the del for email>>

                Comment

                Working...