aboutsummaryrefslogtreecommitdiff
path: root/test.c
blob: 64c3e043ffeaeb8a7a967ae015e2a7d0434b2470 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
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;
}