title: Symbol could not be resolved C++
body: <p>I have come across this error: 'Symbol 'pa' could not be resolved' in one of my methods.
  The code:</p>
  
  <pre><code> PredefinedAtom* PredefinedSymbolTableCollection::findAtomByLexCode(u_int lex_code) {
        // PredefinedAtom* pa;  // &lt;== ACCEPTED
        for(u_int i = 0; i &lt; pst.size(); i++) {
            if((PredefinedAtom* pa = pst[i]-&gt;findAtomByLexCode(i)) != NULL){// &lt;== BAD 
                            // some code
            }
        }
   }
  </code></pre>
  
  <p>If I declare a type of PredefinedAtom outside of the 'if' scope the code compiles/runs. However if I try declaring a type inside of 'if' the compiler issues a 'Cannot resolve 'pa' symbol' error. 'findAtomByLexCode' either returns a pointer to 'PredefinedAtom*' or NULL.</p>