void init_array(double * array, int len);
void func(double * arr1, double * arr2, double * arr3, int len);
void print_array(double * array, int len);
int main(void)
{
int len;
double element;
double element2;
double element3;
double * arr1 = &element;
double * arr2 = &element2;
double * arr3 = &element3;
printf("\nPrint array's length: ");
scanf("%d", &len);
init_array(arr1, len);
init_array(arr2, len);
func(arr1, arr2, arr3, len);
print_array(arr3, len);
}
void init_array(double * array, int len)
{
int index;
printf("\nInitialize the array:\n");
for (index = 0; index < len; index++)
scanf("%lf", array + index);
}
void func(double * arr1, double * arr2, double * arr3, int len)
{
int index;
for (index = 0; index < len; index++)
*(arr3 + index) = *(arr1 + index) + *(arr2 + index);
}
void print_array(double * array, int len)
{
int index;
for (index = 0; index < len; index++)
printf(" %lf", *(array + index));
}