// c
int *sum_arrays(int *a, int *b) {
int a_size = sizeof(a) / sizeof(int);
int b_size = sizeof(b) / sizeof(int);
int n = min(a_size, b_size);
int *arr = malloc(sizeof(int) * n);
for (int i = 0; i < n; i++) {
arr[i] = a[i] + b[i];
}
return arr;
}
Comments
Leave a comment