Re: Question about 'C' code and use of "void"
- From: "Alexander Grigoriev" <alegr@xxxxxxxxxxxxx>
- Date: Sun, 4 Jun 2006 16:09:18 -0700
"John Carson" <jcarson_n_o_sp_am_@xxxxxxxxxxxxxxx> wrote in message
news:OL8dCQ6hGHA.4712@xxxxxxxxxxxxxxxxxxxxxxx
It works for function pointers to. Thus
void (*fnptr)(int);
declares a variable called fnptr that is a pointer to a function that
takes an int argument and returns void, whereas
typedef void (*fnptr)(int);
declares a typename called fnptr that is an alias for the type of a
pointer to a function that takes an int argument and returns void.
A typedef can also be used to define a function (not function pointer) type.
Such a typedef can be used to declare (though not define) non-member AND
member functions. You will still need to start the function body definition
without typedef.
.
- References:
- Re: Question about 'C' code and use of "void"
- From: John Carson
- Re: Question about 'C' code and use of "void"
- Prev by Date: Re: Quick Question!
- Next by Date: OT: stroke "orientation"
- Previous by thread: Re: Question about 'C' code and use of "void"
- Next by thread: Stack Tracing
- Index(es):
Relevant Pages
|