www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - Array initializing causes segfault

reply Nick <Nick_member pathlink.com> writes:
# import std.stdio;
#
# void main()
# {
#   char ch = ' ';
#   char[] u;
#   u.length = 3;
#
#   int i = 2;
#
#   writefln("a");
#   u[0..2] = ch;
#   writefln("b");
#   u[0..i] = ch;
#   writefln("c");
# }

Output: (on linux)
a
b
Segmentation fault

Nick
Aug 27 2004
parent "Walter" <newshound digitalmars.com> writes:
Ouch!
Aug 28 2004