Mercurial > projects > ldc
annotate tests/mini/bug10.d @ 1642:f49cb50c6064
Revert 1637 because it breaks HelloWorld with Tangos Stdout. There may be another way to fix this so that Deewiants case works, as well as Tango.
author | Kelly Wilson <wilsonk cpsc.ucalgary.ca> |
---|---|
date | Mon, 08 Mar 2010 23:10:26 -0700 |
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 } |