aboutsummaryrefslogtreecommitdiff
path: root/test.c
diff options
context:
space:
mode:
authorCamil Staps2016-01-31 14:46:55 +0100
committerCamil Staps2016-01-31 14:46:55 +0100
commit2fb8dc632b4c007033d9a40c6d6ab060d1ea1fe3 (patch)
tree1877df4581887fd0e79aa396b64e61b28ada87a3 /test.c
parentMakefile (diff)
Working version
Diffstat (limited to 'test.c')
-rw-r--r--test.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/test.c b/test.c
new file mode 100644
index 0000000..64c3e04
--- /dev/null
+++ b/test.c
@@ -0,0 +1,25 @@
+#include <stdlib.h>
+#include <string.h>
+
+double test_double(double x) {
+ return x * 0.5;
+}
+
+char* test_string(char* s) {
+ int l = strlen(s);
+ char* r = malloc(sizeof(char) * (l + 1));
+ int i = 0;
+ for (; i<l; i++)
+ r[l-i-1] = s[i];
+ r[l] = '\0';
+ return r;
+}
+
+int test_int(int i) {
+ return i * 2;
+}
+
+int test_two_params(int a, int b) {
+ return a + b;
+}
+