0

Is it possible, in C, to define a function, which takes integer values as
argument, through the values it assumes at the each one of the value
of its arguments? Something like the below (which does NOT work):

double f(int i);

for (i = 0; i < N; i++)
    f(i) = table_of_values[i]; //some predefined array of values

I know arrays are best in this simple case but I wanted to use this
to define a function, like the f(i) above, in terms of another function
of more arguments but holding all the other arguments fixed, like in
f(i) = g(i,a) for a given function g and parameter a.

  • 1
    Take a look at these questions: http://stackoverflow.com/questions/1023261/is-there-a-way-to-do-currying-in-c http://stackoverflow.com/questions/12991014/functional-programming-currying-in-c-issue-with-types – mtijanic Apr 13 '16 at 17:10
  • Thanks! I'm reading Dami's paper. Seems exactly what I was looking for. Cheers! – Daniel Vanzella Apr 13 '16 at 17:27

0 Answers0