If I understand the requirements - an array of arrays in which you don't know the size until runtime - it sounds like you want some sort of data structure, for example a linked list, tree, or graph...