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
Post a Comment