Array is already defined
Steven Schveighoffer
schveiguy at yahoo.com
Fri Jan 5 16:55:50 UTC 2018
On 1/5/18 11:39 AM, Vino wrote:
>
> Hi Steve,
>
> if we add the braces we are getting the Error: undefined identifier
> Datacol
>
> void main () {
> Array!int Keycol;
> static foreach(i; 0 .. 3) {
> {
> typeof(read()[i]) Datacol;
> Datacol.insertBack(sort(read[i].dup[]).uniq);
> foreach(k; read[i]) { Keycol.insertBack(Datacol[].countUntil(k));}
> }
> }
> writeln (Datacol[], Keycol[]);
> }
That's because writeln is outside the loop that defines Datacol.
Without knowing what you are trying to do, it's hard to further help.
-Steve
More information about the Digitalmars-d-learn
mailing list