title: Why do I get this error when I try to add these arrays in C?
body: <p>Basically, I'm trying to create another array to save the sum of the number in the first position in &quot;arreglo1&quot; with the last one in &quot;arreglo2&quot; (3+1), but I get an error at time of compiling that says &quot;expression must have pointer-to-object type but it has type int&quot;. What am I doing wrong? ;(</p>
  <pre><code>#include &lt;stdio.h&gt;
  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 &lt; 5; i++)
      {
          arreglo3[i]= arreglo1[i]+arreglo2[n-1];
      }
      for ( i = 0; i &lt; 5; i++)
      {
          printf(&quot;%d&quot;,arreglo3[i]);
      }
  }
  </code></pre>