title: error: name lookup of ‘i’ changed for ISO ‘for’ scoping [-fpermissive]
body: <p>Q. Write a program that 'bleeps' out words that you don't like; that is, you read in words using cin and print them again on cout. If a word is among a few you have defined, you write out BLEEP instead of that word. (stroustrup's c++ book)</p>
  
  <p>Here's the code I wrote:</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;string&gt;
  #include &lt;vector&gt;
  #include &lt;algorithm&gt;
  #include &lt;cmath&gt;
  using namespace std;
  inline void keep_window_open() { char ch; cin &gt;&gt; ch; }
  int main() 
  {
    vector&lt;string&gt; disliked;
    disliked.push_back("Broccoli");
    disliked.push_back("Carrots");
    disliked.push_back("Tomatoes");
    disliked.push_back("Asparagus");
  
    vector&lt;string&gt; words;
    string word;
    while (cin &gt;&gt; word) {
      words.push_back(word);
    }
    for (int i = 0; i &lt; words.size(); ++i) {
      cout &lt;&lt; words[i] &lt;&lt; "\t";     //i used it to see if the program was working
      }
    for (int j = 0; j &lt; disliked.size(); ++j) {
      cout &lt;&lt; disliked[j] &lt;&lt; "\t";
    }
    for (i = 0; i &lt; j; ++i) {
       if (words[i] == disliked[j]) {
     cout &lt;&lt; "BLEEP";
     }
     else {
     }
    }
  }  
  </code></pre>
  
  <p>I think the problem arises due to my final for loop, but I don't understand what is to be done.</p>
  
  <p>Here is the error I got:</p>
  
  <pre><code>bleep.cpp: In function ‘int main()’:
  bleep.cpp:27:8: error: name lookup of ‘i’ changed for ISO ‘for’ scoping [-fpermissive]
  bleep.cpp:27:8: note: (if you use ‘-fpermissive’ G++ will accept your code)
  bleep.cpp:27:19: error: name lookup of ‘j’ changed for ISO ‘for’ scoping [-fpermissive]
  </code></pre>