Mercurial > projects > ldc
diff test/foreach3.d @ 34:4648206ca213 trunk
[svn r38] * resizing dynamic arrays support
* throw is replaced with assert(0)
* catch is ignored
* better foreach support
* various bugfixes
author | lindquist |
---|---|
date | Tue, 09 Oct 2007 02:50:00 +0200 |
parents | |
children | d9d5d59873d8 |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/foreach3.d Tue Oct 09 02:50:00 2007 +0200 @@ -0,0 +1,19 @@ +module foreach3; + +void main() +{ + static str = ['h','e','l','l','o']; + foreach(i,v; str) { + printf("%c",v); + } + printf("\n"); + + foreach(i,v; str) { + v++; + } + + foreach(i,v; str) { + printf("%c",v); + } + printf("\n"); +}