我创了一个测试function能不能成功的case但当我运行的时候会给我报错
这个是公式
#include "number.h"
#define arraylength 5
int Printoutarray1(int* array1[])
{
printf("their is your array1:\n");
for (int i = 0; i < arraylength; i++)
{
printf("%d ", &array1[i]);
}
printf("\n");
return Printoutarray1;
}
int Printoutarray2(int* array2[])
{
printf("their is your array1:\n");
for (int i = 0; i < arraylength; i++)
{
printf("%d ", &array2[i]);
}
printf("\n");
return Printoutarray2;
}
int Mutiplyarrays(int array1[], int array2[], int sum[])
{
for (int i = 0; i < arraylength; i++)
// make the formular
sum[i] = array1[i] * array2[i];
return Mutiplyarrays;
```c
这是测试function能不能成功的程序
#include "../item3/number.h"
#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
int main(void)
{
int expect1[] = { -1, 0, 20, 10, -24 };
int expect2[] = { 1, 0, 20, 10, 24 };
int sum = 0;
int array1[] = { -1, 0, 5, 5, 3 };
int array2[] = { 1,2,4,2,-8 };
printf("TEST 1: ");
sum = Mutiplyarrays(array1, array2, sum);
if (sum == expect1[4])
printf("pass\n");
else
printf("fail\n");
printf("TEST 2: ");
sum = Mutiplyarrays(array1, array2, sum);
if (sum == expect2[4])
printf("pass\n");
else
printf("fail\n");
return sum;
}
这是给我报错的信息