Translation of C function pointer.

Yao G. yao.gomez at spam.gmail.com
Wed Sep 15 14:22:19 PDT 2010


On Wed, 15 Sep 2010 16:15:12 -0500, Steven Schveighoffer  
<schveiguy at yahoo.com> wrote:

> D supports C-style function pointers.  See here:
>
> typedef char sqlite3_vfs;
>
> // note you can't use void as a parameter type in D
> void (*(*xDlSym)(sqlite3_vfs*,void*, const char *zSymbol))(/*void*/);
> pragma(msg, typeof(xDlSym).stringof);
>
> outputs:
>
> void function() function(sqlite3_vfs*, void*, const const(char*) zSymbol)
>
> so I think it's a function pointer that takes those parameters and  
> returns a function pointer that takes no parameters and returns nothing.
>
> -Steve

Thanks Steve!

-- 
Yao G.


More information about the Digitalmars-d-learn mailing list