PageRenderTime 102ms CodeModel.GetById 22ms RepoModel.GetById 0ms app.codeStats 0ms

/tags/Root-branch-php-utl/SWIG/Examples/ruby/funcptr/example.c

#
C | 17 lines | 12 code | 4 blank | 1 comment | 0 complexity | b885585a05bb9fcedff6a49b2eff03d1 MD5 | raw file
Possible License(s): LGPL-2.1, Cube, GPL-3.0, 0BSD, GPL-2.0
  1. /* File : example.c */
  2. int do_op(int a, int b, int (*op)(int,int)) {
  3. return (*op)(a,b);
  4. }
  5. int add(int a, int b) {
  6. return a+b;
  7. }
  8. int sub(int a, int b) {
  9. return a-b;
  10. }
  11. int mul(int a, int b) {
  12. return a*b;
  13. }