how to read a string array property of an outer class?

39 views Asked by At

The following results in an error : The expression 'outie.s' does not denote an array.

What is the correct way to read/write to outie.s from innie()?

class outie {
    public string[] s;
    public class innie {
        public innie () {
            s[0] = string.joinv("/",s);
        }
    }
    public outie (string h) {
        s = h.split(";");
        print("s.length is %d\n",s.length);
        innie wut = new innie();
    }
}

void main() {
    outie huh = new outie("c:;1;usr;test");
}

I've tried public vs private and {get;set;}... only thing that worked was to make the array global.

0

There are 0 answers