int main(){
int n = arc4random() % 64;
int f(int n){
return n << 1;
}
printf("f(%d) = %d\n", n, f(n));
printf("f(f(%d)) = %d\n", n, f(f(n)));
composed_func c;
compose(f, f, &c);
printf("compose(f,f)(%d) = %d\n", n, c.call(n));
return 0;
}
Name:
Anonymous2008-05-15 12:14
>>12
I really hope you're ``trolling'', and not actually thinking I mistook this shift for C++ i/o. But if that's not the case: C can't have nested functions, and that's what I pointed out in >>3