[ create a new paste ] login | about

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

C, pasted on Aug 29:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#include<stdio.h>

int fun(int, int);
typedef int (*pf) (int, int);
int proc(pf, int, int);

int main()
{
    printf("%d\n", proc(fun, 6, 6));
    return 0;
}
int fun(int a, int b)
{
   return (a==b);
}
int proc(pf p, int a, int b)
{
   return ((*p)(a, b));
}


Output:
1
1


Create a new paste based on this one


Comments: