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

linux - Mailx and Gmail nss config dir -

c# - Is it possible to remove an existing registration from Autofac container builder? -

php - Mysql PK and FK char(36) vs int(10) -