Hello guys,I am still uncertain how to do it right when it comes to lambda functions. For instance: how do I multiply all the elements in an array ?
int product(const ref int[] arr){ int p = 1; foreach(i;arr) p*=i; return p; }
Namal via Digitalmars-d-learn Sat, 12 Dec 2015 15:16:30 -0800
Hello guys,I am still uncertain how to do it right when it comes to lambda functions. For instance: how do I multiply all the elements in an array ?
int product(const ref int[] arr){ int p = 1; foreach(i;arr) p*=i; return p; }