PageRenderTime 54ms CodeModel.GetById 23ms RepoModel.GetById 1ms app.codeStats 0ms

/trunk/Examples/php/pointer/example.c

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