Dynamic memory

Adam D. Ruppe via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Tue Jul 28 09:12:26 PDT 2015


On Tuesday, 28 July 2015 at 16:09:46 UTC, Binarydepth wrote:
> 		readf(" %d %d", &nam[0][num], &nam[1][num]);
> 	}
> 	foreach(nim; 0..num)	{
> 		writef(" %d %d\n", &nam[0][num], &nam[1][num]);

Those indexes are backwards. And you really shouldn't need & on 
write. so try:

  		readf(" %d %d", &nam[num][0], &nam[num][1]);

and

  		writef(" %d %d\n", nam[num][0], nam[num][1]);


More information about the Digitalmars-d-learn mailing list