*** empty log message ***
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@50 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
bcef419b66
commit
16ac3b10f8
16 changed files with 517 additions and 0 deletions
21
SWIG/Examples/python/simple/example.c
Normal file
21
SWIG/Examples/python/simple/example.c
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
/* Simple example from documentation */
|
||||
/* File : example.c */
|
||||
|
||||
#include <time.h>
|
||||
|
||||
double My_variable = 3.0;
|
||||
|
||||
int fact(int n) {
|
||||
if (n <= 1) return 1;
|
||||
else return n*fact(n-1);
|
||||
}
|
||||
|
||||
int mod(int n, int m) {
|
||||
return (n % m);
|
||||
}
|
||||
|
||||
char *get_time() {
|
||||
long ltime;
|
||||
time(<ime);
|
||||
return ctime(<ime);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue