Mercurial > projects > ldc
annotate tests/mini/bug10.d @ 885:8ad512fd8e8f
tag 0.9 revision
author | Christian Kamm <kamm incasoftware de> |
---|---|
date | Mon, 12 Jan 2009 07:55:17 +0100 |
parents | 1bb99290e03a |
children |
rev | line source |
---|---|
40 | 1 module bug10; |
270
d9d5d59873d8
[svn r291] Fixed a bunch of the old Phobos tests to work with Tango.
lindquist
parents:
40
diff
changeset
|
2 extern(C) int printf(char*, ...); |
d9d5d59873d8
[svn r291] Fixed a bunch of the old Phobos tests to work with Tango.
lindquist
parents:
40
diff
changeset
|
3 |
40 | 4 class C |
5 { | |
6 char[] msg; | |
7 | |
8 this() | |
9 { | |
10 } | |
11 this(char[] msg) | |
12 { | |
13 this.msg = msg; | |
14 } | |
15 } | |
16 | |
17 void main() | |
18 { | |
19 auto c = new C(); | |
20 c.msg = "world"; | |
21 auto b = new C("hello"); | |
22 printf("%.*s\n", b.msg.length, b.msg.ptr); | |
23 printf("%.*s\n", c.msg.length, c.msg.ptr); | |
24 } |