title: Error message: name lookup of ‘jj’ changed for ISO ‘for’ scoping, (if you use ‘-fpermissive’ G++ will accept your code)
body: <p>The error is:</p>
  
  <pre><code>In function ‘int returnShortestWeightedBranch(std::vector&lt;route, std::allocator&lt;route&gt; &gt;*)’:
  error: name lookup of ‘jj’ changed for ISO ‘for’ scoping
  note: (if you use ‘-fpermissive’ G++ will accept your code)
  </code></pre>
  
  <p>The code is:</p>
  
  <pre><code>for (int i = 0; i&lt; routeVector.size(); i++)
          {
              if (routeVector[i].exitPoint == exitPointDetailsVector[preserveL].exitPoint)
              {
                  cout &lt;&lt; "\n-----------parent: " &lt;&lt; routeVector[i].exitPoint;
                  branch obj;
                  obj.connectedExitPoint = exitPointDetailsVector[preserveI].exitPoint;
                  routeVector[i].selectedBranchesVector.push_back (obj);
  
                  for (int jj = 0; jj &lt; routeVector[i].selectedBranchesVector.size(); jj++);
                  {
                      cout &lt;&lt; "\n-----------branch: " &lt;&lt; routeVector[i].selectedBranchesVector[jj].connectedExitPoint;
                  }
              }
          }
  </code></pre>
  
  <p>What can be the problem here? </p>
  
  <p><em><strong>EDIT 1:</em></strong></p>
  
  <p>I changed the following:</p>
  
  <pre><code>for (int jj = 0; jj &lt; routeVector[i].selectedBranchesVector.size(); jj++);
  </code></pre>
  
  <p>to:</p>
  
  <pre><code>int jj;
  for (jj = 0; jj &lt; routeVector[i].selectedBranchesVector.size(); jj++);
  </code></pre>
  
  <p>and now it is working!! I fail to understand the REASONS.</p>