swig/Examples/php/cpointer/example.c
William S Fulton 8e6a539d89 Fix crash in php example
Declaration and definition of the add function were different
2014-02-15 19:34:42 +00:00

16 lines
242 B
C

/* 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;
}