Mercurial > projects > ldc
annotate tests/mini/memory1.d @ 670:4f004553de33
Fixed dynamic array -> boolean. does (arr.ptr !is null) now instead of (arr.length != 0)
author | Tomas Lindquist Olsen <tomas.l.olsen@gmail.com> |
---|---|
date | Wed, 08 Oct 2008 22:38:52 +0200 |
parents | 1bb99290e03a |
children |
rev | line source |
---|---|
34 | 1 module memory1; |
2 | |
133
44a95ac7368a
[svn r137] Many fixes towards tango.io.Console working, but not quite there yet...
lindquist
parents:
34
diff
changeset
|
3 extern(C) int printf(char*,...); |
44a95ac7368a
[svn r137] Many fixes towards tango.io.Console working, but not quite there yet...
lindquist
parents:
34
diff
changeset
|
4 |
34 | 5 void main() |
6 { | |
7 auto a = new int[16]; | |
8 {printf("array.length = %u\n", a.length);} | |
9 {a.length = a.length + 1;} | |
10 {printf("array.length = %u\n", a.length);} | |
11 {assert(a.length == 17);} | |
12 } |