C++ variable scope error inside for loop
<pre><code>//Constructing set of all Places in Conflict with each other
int l_placeVec, l_placeVec1,p;
for(SP_ListListNode::const_iterator iter = m_postTransitionsSet.begin(),l_placeVec=0; iter != m_postTransitionsSet.end(); iter++,l_placeVec++) {
    for(SP_ListListNode::const_iterator inneriter = m_postTransitionsSet.begin(),l_placeVec1=0; inneriter != m_postTransitionsSet.end(); inneriter++,l_placeVec1++) {
        if((iter != inneriter) &amp;&amp; ((**inneriter) == (**iter)) &amp;&amp; (((int)((*iter)-&gt;size()))&gt;1)) { //when the two lists are same
            SP_ListNode* temper = new SP_ListNode;
            temper-&gt;clear();
            for(SP_ListNode::const_iterator iterplaces = m_placeNodes-&gt;begin(),p=0; iterplaces != m_placeNodes-&gt;end(); iterplaces++,p++) {
                if((p == l_placeVec) || (p == l_placeVec1)) {
                    temper-&gt;push_back(*iterplaces);
                }
            }
            m_conflictingPlaces.push_back(temper);
        }
    }
}
</code></pre>

<p>The above code is saying: "Unused variable p", though I am using it in the third for loop.
In case further information is required, please leave a comment.</p>

<p>But this is something weird I am facing.</p>
