c++ - Can I create a for loop containing multiple type declarations? -


for example:

is there can do, might allow me this:

for(tixmlelement * pchild = elem->first(), int i=0; // note multiple type declarations     pchild;      pchild=pchild->nextsiblingelement(), i++) // note multiple types {     //do stuff } 

perhaps there boost header?

nope.

if want limit scope of variables loop add scope:

{     tixmlelement * pchild = elem->first();     int = 0;     for(; pchild; pchild=pchild->nextsiblingelement(), i++)     {         //do stuff     } } 

Comments

Popular posts from this blog

mod rewrite - Doing external redirect. .htaccess NS flag not working. How to achieve similar results? -

mysql - How to insert just year and month into date field? -