swig/Examples/php4/simple/example.c
Kevin Ruland 8f8271a7fe Added stdio.h include.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@8736 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2006-02-07 14:37:29 +00:00

23 lines
323 B
C

/* File : example.c */
#include <stdio.h>
/* A global variable */
double Foo = 3.0;
void print_Foo() {
printf("In C, Foo = %f\n",Foo);
}
/* Compute the greatest common divisor of positive integers */
int gcd(int x, int y) {
int g;
g = y;
while (x > 0) {
g = x;
x = y % x;
y = g;
}
return g;
}