PageRenderTime 9ms CodeModel.GetById 2ms app.highlight 4ms RepoModel.GetById 1ms app.codeStats 0ms

/trunk/Examples/php/funcptr/example.c

#
C | 17 lines | 12 code | 4 blank | 1 comment | 0 complexity | b885585a05bb9fcedff6a49b2eff03d1 MD5 | raw file
 1/* File : example.c */
 2
 3int do_op(int a, int b, int (*op)(int,int)) {
 4  return (*op)(a,b);
 5}
 6
 7int add(int a, int b) {
 8  return a+b;
 9}
10
11int sub(int a, int b) {
12  return a-b;
13}
14
15int mul(int a, int b) {
16  return a*b;
17}