diff options
author | Camil Staps | 2016-01-31 14:46:55 +0100 |
---|---|---|
committer | Camil Staps | 2016-01-31 14:46:55 +0100 |
commit | 2fb8dc632b4c007033d9a40c6d6ab060d1ea1fe3 (patch) | |
tree | 1877df4581887fd0e79aa396b64e61b28ada87a3 /test.c | |
parent | Makefile (diff) |
Working version
Diffstat (limited to 'test.c')
-rw-r--r-- | test.c | 25 |
1 files changed, 25 insertions, 0 deletions
@@ -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; +} + |