summaryrefslogtreecommitdiff
path: root/trunk/Examples/lua/pointer/example.c
blob: b877d9a5bfc140094563ab9572026f931dadbdea (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
/* File : example.c */

void add(int *x, int *y, int *result) {
  *result = *x + *y;
}

void sub(int *x, int *y, int *result) {
  *result = *x - *y;
}

int divide(int n, int d, int *r) {
   int q;
   q = n/d;
   *r = n - q*d;
   return q;
}