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

A

angelo

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

void (*vector[])( )

can be simplied (in terms of readability) as

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

Trent Buck

Quoth Ben Pfaff on or about 2004-11-12:
array of pointer to function returning void

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
 
M

Martin Ambuhl

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

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.
 
S

Stuart Gerchick

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

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
 
R

Robert Gamble

This is an array of functions each with no (undefined) argument list

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

Rob Gamble
 
B

Barry Schwarz

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

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>>
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,150
Messages
2,570,853
Members
47,394
Latest member
Olekdev

Latest Threads

Top