/tags/rel-1.3.35/Examples/lua/pointer/example.c
C | 16 lines | 12 code | 3 blank | 1 comment | 0 complexity | b797a4b4e475faceea65d5797a12bf2b MD5 | raw file
Possible License(s): LGPL-2.1, Cube, GPL-3.0, 0BSD, GPL-2.0
1/* File : example.c */
2
3void add(int *x, int *y, int *result) {
4 *result = *x + *y;
5}
6
7void sub(int *x, int *y, int *result) {
8 *result = *x - *y;
9}
10
11int divide(int n, int d, int *r) {
12 int q;
13 q = n/d;
14 *r = n - q*d;
15 return q;
16}