Basically, I'm trying to create another array to save the sum of the number in the first position in "arreglo1" with the last one in "arreglo2" (3+1), but I get an error at time of compiling that says "expression must have pointer-to-object type but it has type int". What am I doing wrong? ;(
#include <stdio.h>
int funcion1(int arreglo1,int arreglo2);
int main()
{
int arreglo1[5]={3,5,1,4,-2};
int arreglo2[5]={8,7,2,5,1};
funcion1 (arreglo1,arreglo2);
}
int funcion1(int arreglo1,int arreglo2){
int arreglo3[]={};
int n=5;
int i;
int suma;
for ( i = 0; i < 5; i++)
{
arreglo3[i]= arreglo1[i]+arreglo2[n-1];
}
for ( i = 0; i < 5; i++)
{
printf("%d",arreglo3[i]);
}
}