Strange behaviour with mmfile

H. S. Teoh hsteoh at quickfur.ath.cx
Mon Jan 28 22:35:11 PST 2013


On Tue, Jan 29, 2013 at 05:46:49AM +0100, nazriel wrote:
> On Tuesday, 29 January 2013 at 00:49:07 UTC, bioinfornatics wrote:
> >I missed to show the code
> >
> >$ cat test_mmap.d
> >import std.stdio;
> >import std.mmfile;
> >
> >void main(string[] args ){
> >    MmFile m = new MmFile( args[0] );
> >    foreach( ulong c; 0..m.length )
> >        writeln( m[c], " ", cast(dchar) m[c] );
> >}
> 
>  MmFile m = new MmFile( args[0] ); ?
> Didn't you mean args[1] or something?
[...]

Good catch! I looked at the OP's code and didn't notice that. :)

In D, args[0] is the name of the program, and args[1] is the first
argument, etc..


T

-- 
Nearly all men can stand adversity, but if you want to test a man's character, give him power. -- Abraham Lincoln


More information about the Digitalmars-d-learn mailing list