Jarrett Billingsley Wrote:

> On Mon, Dec 29, 2008 at 10:36 PM, Michael P. <[email protected]> wrote:
> > import std.stdio;
> > import std.cstream;
> > void main()
> > {
> >  char[][] names;
> >  char[] currentName;
> >  while( true )
> >  {
> >    din.readf( "%s", &currentName );
> >    if( currentName == "stop" )
> >    {
> >      break;
> >    }
> >    else
> >    {
> names ~= currentName;
> >    }
> >  }
> >  foreach( name; names )
> >  {
> >    writefln( name );
> >  }
> > }
> 
> ~= performs an append.  It adds the given item to the end of the array.

Under 1.036, this does not work.

Input:
michael
is
cool
stop

The output is:
stopeal
st
stop

What seems to be happening is that the letters of stop are added to the word, 
and if the word is longer than stop, then the rest of the letters of the word 
are added.
So, I'm not sure if this is a bug or what...
-Michael P.

Reply via email to