summaryrefslogtreecommitdiff
path: root/Examples/fortran/array/example.c
diff options
context:
space:
mode:
Diffstat (limited to 'Examples/fortran/array/example.c')
-rw-r--r--Examples/fortran/array/example.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/Examples/fortran/array/example.c b/Examples/fortran/array/example.c
new file mode 100644
index 000000000..d720509f2
--- /dev/null
+++ b/Examples/fortran/array/example.c
@@ -0,0 +1,23 @@
+/* File : example.c */
+#include <stdio.h>
+
+/* A global variable */
+double Foo = 3.0;
+
+/* Compute the greatest common divisor of positive integers */
+int* incrArrayInt(int *x, int nmemb) {
+ g = y;
+ while (x > 0) {
+ g = x;
+ x = y % x;
+ y = g;
+ }
+ return g;
+}
+
+void sayhi(char *str, int y, char *ret) {
+ if (ret != NULL) {
+ sprintf(ret, "hello %s", str);
+ }
+ return;
+}