example.c was not in the cvs repository

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@468 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
Harco de Hilster 2000-06-15 10:48:54 +00:00
commit 0be037a624
2 changed files with 25 additions and 1 deletions

View file

@ -0,0 +1,24 @@
/* Simple example from documentation */
/* File : example.c */
#include <time.h>
double My_variable = 3.0;
/* Compute factorial of n */
int fact(int n) {
if (n <= 1) return 1;
else return n*fact(n-1);
}
/* Compute n mod m */
int my_mod(int n, int m) {
return (n % m);
}
char *get_time() {
long ltime;
time(&ltime);
return ctime(&ltime);
}