Dynamic memory

Binarydepth via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Tue Jul 28 09:23:49 PDT 2015


On Tuesday, 28 July 2015 at 16:12:28 UTC, Adam D. Ruppe wrote:
> 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]);

I declared : int[2][] nam;

For real it is backwards ? nam[0][num]


More information about the Digitalmars-d-learn mailing list