Passing function as values and returning functions

Steven Schveighoffer schveiguy at yahoo.com
Wed Apr 11 06:04:00 PDT 2012


On Wed, 11 Apr 2012 08:53:00 -0400, Xan <xancorreu at gmail.com> wrote:

>
> Thanks, Steve, but another problem:
>

[snip]

> void main() {
> |___writeln(g(f)(1));
> }

writeln(g(&f)(1));

Unlike C, you *must* take the address of a function symbol to get a  
function pointer.

-Steve


More information about the Digitalmars-d-learn mailing list