Changing the foreach key...

Lionello Lunesu lio at lunesu.remove.com
Mon Oct 30 05:52:42 PST 2006


Is this according to the spec?

#void main(char[] args[])
#{
#	foreach(i,l;args[0]) {
#		printf("%c\n",l);
#		++i;
#	}
#}

I'm changing the key (index) inside the foreach, and foreach actually 
uses my index. The example above prints every other character.

L.



More information about the Digitalmars-d-learn mailing list