/trunk/Examples/lua/pointer/example.c
# · C · 16 lines · 12 code · 3 blank · 1 comment · 0 complexity · b797a4b4e475faceea65d5797a12bf2b MD5 · raw file
- /* 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;
- }