#include <assert.h>
#include <stdio.h>
#include <stdlib.h>

void pretty_print(uint size, int v[]) {
    printf("[");
    for  (int i = 0; i < size; i++)
        printf("%d,", v[i]);
    printf("]\n");
}

int* vec_add(int v1[], int v2[], int size) {
    int* res =  malloc(size * sizeof(int));
    for (int i = 0; i < size; i++) {
        res[i] = v1[i] + v2[i];
    }
    return res;
}

void dps_vec_add(int res[], int v1[], int v2[], int size) {
    for (int i = 0; i < size; i++) {
        res[i] = v1[i] + v2[i];
    }
}

#define SIZE 5
int main(int argc, char** argv) {
    int v1[SIZE] = {1, 2, 4, 5, 10};
    int v2[SIZE] = {2, 2, 1, 2, 1};
    int *added = vec_add(v1, v2, SIZE);
    pretty_print(SIZE, added);

    int dest[SIZE] = {2, 2, 1, 2, 1};
    dps_vec_add(dest, v1, v2, SIZE);
    pretty_print(SIZE, dest);
    return 0;
}

