/trunk/Examples/perl5/pointer/example.c
C | 16 lines | 12 code | 3 blank | 1 comment | 0 complexity | 853242edaca370ba72b611ea81a469ce MD5 | raw file
Possible License(s): LGPL-2.1, Cube, GPL-3.0, 0BSD, GPL-2.0
- /* File : example.c */
- void add(int *x, int *y, int *result) {
- *result = *x + *y;
- }
- void subtract(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;
- }