Mercurial > projects > dstress
annotate run/foreach_04.d @ 0:3269e4627918
init dstress
author | svnowner |
---|---|
date | Sat, 25 Sep 2004 22:33:30 +0000 |
parents | |
children | 3414705c41ac |
rev | line source |
---|---|
0 | 1 // $Header: /home/th/Dokumente/Entwicklung/MEIN_CVS/MiniD/src/run/foreach_04.d,v 1.1 2004/09/21 21:04:47 th Exp $ |
2 | |
3 int main(){ | |
4 int array[3]; | |
5 array[0]=0; | |
6 array[1]=2; | |
7 array[2]=4; | |
8 int count=0; | |
9 assert(count==0); | |
10 foreach(int index, int value; array){ | |
11 assert(index*2==value); | |
12 count++; | |
13 } | |
14 assert(count==3); | |
15 return 0; | |
16 } |