for versus foreach

Frank Benoit benoit__ at __tionex.de
Sat Apr 8 12:32:21 PDT 2006


Ameer Armaly schrieb:
> What are the reasons/differences in using foreach over a for loop?  Is
> it just performance or readability?
> 

foreach
* better readable
* looping is allways the same. For arrays, linked lists etc.
* the container itself controls the loop automagically.



More information about the Digitalmars-d-learn mailing list