annotate tests/mini/strings1.d @ 1651:cb960b882ca3 tip

bindings were moved to dsource.org/projects/bindings/
author Moritz Warning <moritzwarning@web.de>
date Thu, 20 May 2010 20:05:03 +0200
parents 1bb99290e03a
children
rev   line source
lindquist@21 1 module strings1;
lindquist@270 2 extern(C) int printf(char*, ...);
lindquist@21 3 void f(char[11] buffer)
lindquist@21 4 {
lindquist@21 5 printf("%.*s\n", buffer.length, buffer.ptr);
lindquist@21 6 }
lindquist@21 7
lindquist@21 8 void main()
lindquist@21 9 {
lindquist@21 10 char[11] buffer;
lindquist@21 11 char[] hello = "hello world";
lindquist@21 12 {buffer[] = hello[];}
lindquist@21 13 {f(buffer);}
lindquist@21 14 {f("eleven char");}
lindquist@21 15 }