C style function pointers

via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Tue Aug 26 05:30:08 PDT 2014


On Tuesday, 26 August 2014 at 12:26:45 UTC, nikki wrote:
> void main()
> {
>    writeln(interpolate(100,100,10, lineair_interpolation));
> }
>
> this errors witha : Error: function test.lineair_interpolation
> (float p) is not callable using argument types (), but I don't
> really know where to go from here.

You need to put an `&` before the function name:

     writeln(interpolate(100,100,10, &lineair_interpolation));


More information about the Digitalmars-d-learn mailing list