associative array and function

BCS ao at pathlink.com
Fri Aug 1 12:28:42 PDT 2008


Reply to Zarathustra,

> only input data is modified
> 

are you asking a question or pointing out an issue or just replying to that 
last thread?

> module main;
> import std.stdio;
> import std.process;
> void Function(in uint[int]o_a){
> foreach(l_a; o_a.keys)o_a.remove(l_a);
> }
> void
> main(char [][] args){
> uint[int]l_a;
> l_a[1] = 0;
> l_a[2] = 3;
> writefln(l_a.length);  // 2
> Function(l_a);
> writefln(l_a.length);  // 0
> system("pause");
> }




More information about the Digitalmars-d-learn mailing list