#include<stdio.h>
#define SIZE 4
void add_ar(int source1[], int source2[], int target[], int size);
void output_ar(int arr[], int m);
int main(void)
{
int a[SIZE] = { 1,2,3,4 };
int b[SIZE] = { 5,6,7,8 };
int c[SIZE] = { 0 };
add_ar(a, b, c, SIZE);
output_ar(c, SIZE);
return 0;
}
void add_ar(int source1[], int source2[], int target[], int size)
{
int i;
for (i = 0; i < size; i++)
target[i] = source1[i] + source2[i];
}
void output_ar(int arr[], int m)
{
int i;
for (i = 0; i < m; i++)
printf("%d\t", arr[i]);
}
转载请注明原文地址:https://ipadbbs.8miu.com/read-53840.html