[Vala] two dimensional arrays



Why this doesn't work? I need some help with two dimensonal arrays 

class test : GLib.Object {

        


        struct Field {
                string name;
                string val;
        }
        
        public static int main(string[] args) {

        int row = 0, col, cols = 5;
        Field[,] results = {};
        
        do {
                for (col = 0; col < cols; col++) {
                        results[row] += Field() { name = "test", val = "bug" };
                }
                row++;
        } while (row < 10);
        
        

        return 0;
        }
}

Attachment: signature.asc
Description: This is a digitally signed message part



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]