title: Resizing the length of an array produced by conditional multiplying two other two arrays
body: <p>Assume that i have 3 arrays of integer which are arr1, arr2 and prod. Where, Arr1 and Arr2  have the same lengths, while prod will be size depends. And I'm trying the following code </p>
  
  <pre><code>for (int i =0; i &lt; arr1.lenght; i++)
  {        
      if (arr1[i]&gt; 0 &amp;&amp; arr2[i]&gt; 0)
          prod[i]= arr1[i]*arr2[i];
  }
  </code></pre>
  
  <p>How could I re-size the array prod in advance ? Could any help please ? many thanks.  </p>