added string appending D example

git-svn-id: svn://anubis/misc/d@90 bd8a9e45-a331-0410-811e-c64571078777
This commit is contained in:
josh committed 2009-02-14 20:27:59 +00:00
1 parent 1a913f52c2
commit f29d300775
2 files changed
+29

No files matched your search

+12
View File
@@ -0,0 +1,12 @@
TARGET := appending
all: $(TARGET)
$(TARGET): $(TARGET).d
%: %.d
gdc -o $@ $<
clean:
-rm -f *.o *~ $(TARGET)
+17
View File
@@ -0,0 +1,17 @@
import std.stdio;
void main()
{
char[] s;
writefln("Length: %d\tString: '%s', &s: 0x%x",
s.length, s, &s);
s ~= "something ";
writefln("Length: %d\tString: '%s', &s: 0x%x",
s.length, s, &s);
s ~= "whatever";
writefln("Length: %d\tString: '%s', &s: 0x%x",
s.length, s, &s);
}