title: C++ - Replace int elements of an array with another
body: <p>I've been going through the Fourth Edition of C++ Primer, and I'm on a pointer exercise right now. The exercise asks to make a program to go through an array and replace the elements with 0. I have this so far:</p>
  
  <pre><code>#include &lt;iostream&gt;
  
  using namespace std;
  
  using std::cout;
  using std::endl;
  
  int main() {
      int arr[5] = {1, 2, 3, 4, 5};
      for (int i = 0; i != 5; i++)
          arr[i] = 0;
          cout &lt;&lt; arr[i] &lt;&lt; endl;
  }
  </code></pre>
  
  <p>But I'm getting an error:</p>
  
  <blockquote>
    <p><code>name lookup of 'i' changed for ISO 'for' scoping</code></p>
  </blockquote>
  
  <p>How do I change the element?</p>