diff options
Diffstat (limited to 'tests/projects/swig/python_cpp/src/example.cpp')
| -rw-r--r-- | tests/projects/swig/python_cpp/src/example.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/projects/swig/python_cpp/src/example.cpp b/tests/projects/swig/python_cpp/src/example.cpp new file mode 100644 index 000000000..31c659bfa --- /dev/null +++ b/tests/projects/swig/python_cpp/src/example.cpp @@ -0,0 +1,14 @@ +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); +} |
