import source from 1.3.40
[external/swig.git] / Examples / lua / pointer / example.c
1 /* File : example.c */
2
3 void add(int *x, int *y, int *result) {
4   *result = *x + *y;
5 }
6
7 void sub(int *x, int *y, int *result) {
8   *result = *x - *y;
9 }
10
11 int divide(int n, int d, int *r) {
12    int q;
13    q = n/d;
14    *r = n - q*d;
15    return q;
16 }