Re: C style function pointers

2014-08-26 Thread nikki via Digitalmars-d-learn
thanks, that worked, I need to grow a feeling for those * and &

Re: C style function pointers

2014-08-26 Thread ketmar via Digitalmars-d-learn
On Tue, 26 Aug 2014 12:26:43 + nikki via Digitalmars-d-learn wrote: > 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 use '&' to get function pointer. i.e. write

Re: C style function pointers

2014-08-26 Thread via Digitalmars-d-learn
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.

C style function pointers

2014-08-26 Thread nikki via Digitalmars-d-learn
as "float function(float) easing" as far as I know and could find here http://dlang.org/deprecate.html#C-style function pointers. so my code is written as: import std.stdio; float interpolate(float from, float to, float amount, float function(float) easing) { return from + (to - fr

Re: C-style function pointers

2011-11-11 Thread Alex Rønne Petersen
On 11-11-2011 11:54, Aaron P wrote: This is a little advanced for me, but I'd rather fix that one line in a library somewhere than compile with -d. I get an error message "C-style function pointer and pointer to array syntax is deprecated. Use 'function' to declare function pointers." Can someo

C-style function pointers

2011-11-11 Thread Aaron P
This is a little advanced for me, but I'd rather fix that one line in a library somewhere than compile with -d. I get an error message "C-style function pointer and pointer to array syntax is deprecated. Use 'function' to declare function pointers." Can someone explain how this keyword is use