That means it's a pointer to a function. The full type is
"pointer to function taking a void * argument and returning void
*".
OK thanks.
That's not a type or a declaration. It's a cast. In a cast,
there is no variable to name, so "a" is omitted. If there was a
variable there, it would be in the same position.
I agree that the type-declaration scheme /is/ logical when you analyse it,
it's just difficult to read! Being adept at it does not change that.
While we're in this fantasy thread, I knocked up this new left-to-right
easy-to-read syntax for C type declarations. Type-decls are constructed with
the following symbols (enums and some other stuff left out):
* Pointer to
type Type name (built-in or typedef-ed)
function Optional function indicator
(...)T Function Takes these params, returns type T
[] Array of
[N] Array of N of
struct{...} Struct of
struct S{...} Struct S of
These are written left to right, example:
*int a,b; a,b are both pointers to int
function(int,int)float Function taking two int params and returning float
result
(int,int)float Same without the 'function'
[10]char s,t s,t are both 10-char arrays
[10]*char list Array of pointers to char (array of strings)
*function(*void)*void Above example
*(*void)*void Above example without 'function'
Pros:
* Easy to read, translates naturally to English
* Variables sharing same array/pointer properties share the one type-decl(as
in above examples)
* The typedef T U statement, in practice may have T and U hopelessly
intermingled for complex type-decls. With this scheme T and U stay separate.
* Also type-decls appear in typedefs, var-decls, casts, and function params
all have the same form
Cons:
* Can't mix declaration of variables that have different array/pointer
attributes (but I think that's a bad idea anyway).