Write a function foo that takes a number n and returns a function that takes a number i, and returns n incremented by i.
My submission, in Scheme
(define (foo num)
(lambda (x) (+ x num)))
Name:
Anonymous2010-07-17 4:08
Any solution which manipulates function pointers is very messy.
(return *func_pointer)(execute_from) vs setting global variable x=n; and using standard function calls
#include <stdio.h>
#include <stdlib.h>
int n=0;
int getn(i){return n+i;}
int main(int agrc,char**argv){
n=10;printf("%i",getn(6));
return 0;
}