title: c++, how to change the objects of the pointers
body: <p>I am quite new to c++.</p>
  
  <p>I was wondering if there was any way to have the pointer of a vector point to an array.</p>
  
  <p>In my program, I have vector iterator objects that point to the first and last element of the vector, like this:</p>
  
  <pre><code>vector&lt;int&gt;::iterator vb = vec.begin();
  vector&lt;int&gt;::iterator ve = vec.end();
  </code></pre>
  
  <p>and I have an array called 'result.'</p>
  
  <p>I want to have 'vb' point to the first element of 'result', and 've' point to the last element of 'result.'</p>
  
  <p>I've tried this:</p>
  
  <pre><code>vb = &amp;result;
  int resultLen = result.size();
  ve = &amp;(result+resultLen);
  </code></pre>
  
  <p>But I ended up with this error: </p>
  
  <pre><code>`error: no match for ‘operator=’ in ‘vb = &amp; result’
  </code></pre>
  
  <p>I tried some variations such as:</p>
  
  <pre><code>*vb = &amp;result;
  int resultLen = result.size();
  *ve = &amp;(result+resultLen);
  </code></pre>
  
  <p>It didn't work either.</p>
  
  <p>Any help will be appreciated, and thank you in advance!! </p>
  
  <p>=============================================================================
  <strong>UPDATE</strong>. This is a simple version of the program I am trying to write. </p>
  
  <pre><code>vector&lt;int&gt;::iterator vb = vec1.begin(); 
  vector&lt;int&gt;::iterator ve = vec1.end();
  
  int arr = {1,2,3}
  int result [10];
  
  while (True) {
      subtraction (vb, ve, arr, arr+5, result); 
  // let's say the vector has {1,2,3,4,5}. I am subtracting array from vector like this: 12345 - 123 until it becomes less than 123. 
          /*I now need to update the vector from which I am subtracting the array to the result array.*/
          vb = &amp;result; //points to the first element of array
          int resultLen = result.size();
          ve = &amp;result+resultLen; //points to the last element of array
      }
  </code></pre>
  
  <p>Updating the vector is where I am having a trouble with. </p>