[ create a new paste ] login | about

Link: http://codepad.org/FVo7dWze    [ raw code | output | fork ]

C, pasted on Sep 28:
1
2
3
4
5
6
7
8
9
10
11
12
13
#include <stdio.h>
 
int (*add(int x))(int){
  int helper(int y){
    return x + y;
  }
  return helper;
}
 
int main(){
  printf("%d",add(2)(3));
  return 0;
}


Output:
1
5


Create a new paste based on this one


Comments: