"Bibi" <bibiNS@yahoo.f r> wrote in message
news:iY4lc.5779 6$mU6.236096@ne wsb.telia.net.. .[color=blue]
> What does the following C declaration means?
>
> void *(disp)(int))
>
> I can't even begin to understand it!
>
> Thank you in advance!
>[/color]
It is a pointer to a function that returns a void and takes an int as an
arguement.
Allan
Bibi wrote:[color=blue]
> What does the following C declaration means?
>
> void *(disp)(int))
>
> I can't even begin to understand it!
>
> Thank you in advance!
>
> --B
>
>[/color]
It is incorrect. What about the brace at the end of the line? If you
have meant
void *(disp)(int);
then this is an equevalent for
void *disp (int);
which is the declaration of function with single argument of type int
which returns pointer to void (nothing).
--B
"Allan Bruce" <allanmb@TAKEAW AYf2s.com> a écrit dans le message de news:
c72mbc$b33$1@ne ws.freedom2surf .net...[color=blue]
>
> "Bibi" <bibiNS@yahoo.f r> wrote in message
> news:iY4lc.5779 6$mU6.236096@ne wsb.telia.net.. .[color=green]
> > What does the following C declaration means?
> >
> > void *(disp)(int))
> >
> > I can't even begin to understand it!
> >
> > Thank you in advance!
> >[/color]
>
> It is a pointer to a function that returns a void and takes an int as an
> arguement.
> Allan
>
>[/color]
Allan Bruce wrote:
[color=blue]
> "Bibi" <bibiNS@yahoo.f r> wrote in message
> news:iY4lc.5779 6$mU6.236096@ne wsb.telia.net.. .
>[color=green]
>>What does the following C declaration means?
>>
>>void *(disp)(int))[/color][/color]
[color=blue]
>
> It is a pointer to a function that returns a void and takes an int as an
> arguement.[/color]
Err, nope... Assuming
void *(disp)(int);
Then it is a function prototype for a function called disp
which returns a pointer to void and takes an int as the argument.
"Thomas stegen" <tstegen@cis.st rath.ac.uk> wrote in message
news:c72o3b$gll 25$1@ID-228872.news.uni-berlin.de...[color=blue]
> Allan Bruce wrote:
>[color=green]
> > "Bibi" <bibiNS@yahoo.f r> wrote in message
> > news:iY4lc.5779 6$mU6.236096@ne wsb.telia.net.. .
> >[color=darkred]
> >>What does the following C declaration means?
> >>
> >>void *(disp)(int))[/color][/color]
>
>[color=green]
> >
> > It is a pointer to a function that returns a void and takes an int as an
> > arguement.[/color]
>
> Err, nope... Assuming
> void *(disp)(int);
>
> Then it is a function prototype for a function called disp
> which returns a pointer to void and takes an int as the argument.
>[/color]
so it is, I should have read more carefully, if the OP had asked about
void (*disp)(int);
then that is a pointer to a function. The OPs function can be rewritten as:
void * disp(int);
which is a 'normal' function called disp returning a void pointer.
"Allan Bruce" <allanmb@TAKEAW AYf2s.com> a écrit dans le message de news:
c72p92$c0l$1@ne ws.freedom2surf .net...[color=blue]
>
> "Thomas stegen" <tstegen@cis.st rath.ac.uk> wrote in message
> news:c72o3b$gll 25$1@ID-228872.news.uni-berlin.de...[color=green]
> > Allan Bruce wrote:
> >[color=darkred]
> > > "Bibi" <bibiNS@yahoo.f r> wrote in message
> > > news:iY4lc.5779 6$mU6.236096@ne wsb.telia.net.. .
> > >
> > >>What does the following C declaration means?
> > >>
> > >>void *(disp)(int))[/color]
> >
> >[color=darkred]
> > >
> > > It is a pointer to a function that returns a void and takes an int as[/color][/color][/color]
an[color=blue][color=green][color=darkred]
> > > arguement.[/color]
> >
> > Err, nope... Assuming
> > void *(disp)(int);
> >
> > Then it is a function prototype for a function called disp
> > which returns a pointer to void and takes an int as the argument.
> >[/color]
>
> so it is, I should have read more carefully, if the OP had asked about
>
> void (*disp)(int);
>
> then that is a pointer to a function. The OPs function can be rewritten[/color]
as:[color=blue]
>
> void * disp(int);
>
> which is a 'normal' function called disp returning a void pointer.
>
> Allan
>
>[/color]
Well sorry for the mistake. it was in fact
void *(disp)(int)
It was in the argument of the function sigset(2).
void(*sigset(in t sig, void (*disp)(int)))( int);
Now it makes sense to me.
Thank you all!
Bibi wrote:
[color=blue]
> What does the following C declaration means?
>
> void *(disp)(int))
>
> I can't even begin to understand it!
>
> Thank you in advance!
>
> --B[/color]
You are missing a parenthesis, but it says 'disp is a pointer to a function
that takes and integer argument'.
Comment