Mercurial > projects > ldc
annotate tests/mini/bug10.d @ 869:5dbc63f83380
Backed out changeset 1fcba307fd28
Wasn't the right thing to do.
author | Christian Kamm <kamm incasoftware de> |
---|---|
date | Sat, 27 Dec 2008 16:07:23 +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 } |